sealed abstract class WebSocketBuilder2[F[_]] extends AnyRef
Build a response which will accept an HTTP websocket upgrade request and initiate a websocket connection using the supplied exchange to process and respond to websocket messages.
- Source
- WebSocketBuilder2.scala
- Alphabetic
- By Inheritance
- WebSocketBuilder2
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def build(send: Stream[F, WebSocketFrame], receive: Pipe[F, WebSocketFrame, Unit]): F[Response[F]]
- send
The send side of the Exchange represents the outgoing stream of messages that should be sent to the client
- receive
The receive side of the Exchange is a sink to which the framework will push the incoming websocket messages Once both streams have terminated, the server will initiate a close of the websocket connection. As defined in the websocket specification, this means the server will send a CloseFrame to the client and wait for a CloseFrame in response before closing the connection, this ensures that no messages are lost in flight. The server will shutdown the connection when it receives the
CloseFramemessage back from the client. The connection will also be closed if the client does not respond with aCloseFrameafter some reasonable amount of time. Another way of closing the connection is by emitting aCloseFramein the stream of messages heading to the client. This method allows one to attach a message to theCloseFrameas defined by the websocket protocol. Unfortunately the current implementation does not quite respect the description above, it violates the websocket protocol by terminating the connection immediately upon reception of aCloseFrame. This bug will be addressed soon in an upcoming release and this message will be removed. Currently, there is no way for the server to be notified when the connection is closed, neither in the case of a normal disconnection such as a Close handshake or due to a connection error. There are plans to address this limitation in the future.
- def build(sendReceive: Pipe[F, WebSocketFrame, WebSocketFrame]): F[Response[F]]
- sendReceive
The send-receive stream represents transforming of incoming messages to outgoing for a single websocket Once the stream have terminated, the server will initiate a close of the websocket connection. As defined in the websocket specification, this means the server will send a CloseFrame to the client and wait for a CloseFrame in response before closing the connection, this ensures that no messages are lost in flight. The server will shutdown the connection when it receives the
CloseFramemessage back from the client. The connection will also be closed if the client does not respond with aCloseFrameafter some reasonable amount of time. Another way of closing the connection is by emitting aCloseFramein the stream of messages heading to the client. This method allows one to attach a message to theCloseFrameas defined by the websocket protocol. Unfortunately the current implementation does not quite respect the description above, it violates the websocket protocol by terminating the connection immediately upon reception of aCloseFrame. This bug will be addressed soon in an upcoming release and this message will be removed. Currently, there is no way for the server to be notified when the connection is closed, neither in the case of a normal disconnection such as a Close handshake or due to a connection error. There are plans to address this limitation in the future.
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def imapK[G[_]](fk: ~>[F, G])(gk: ~>[G, F])(implicit arg0: Applicative[G]): WebSocketBuilder2[G]
Transform the parameterized effect from F to G.
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def withDefragment(defragFrame: Boolean): WebSocketBuilder2[F]
- def withFilterPingPongs(filterPingPongs: Boolean): WebSocketBuilder2[F]
- def withHeaders(headers: Headers): WebSocketBuilder2[F]
- def withOnClose(onClose: F[Unit]): WebSocketBuilder2[F]
- def withOnHandshakeFailure(onHandshakeFailure: F[Response[F]]): WebSocketBuilder2[F]
- def withOnNonWebSocketRequest(onNonWebSocketRequest: F[Response[F]]): WebSocketBuilder2[F]