SocketApp

final case class SocketApp[-R](timeout: Option[ZIO[R, Nothing, Any]], open: Option[Handle[R]], message: Option[Socket[R, Throwable, WebSocketFrame, WebSocketFrame]], error: Option[Throwable => ZIO[R, Nothing, Any]], close: Option[Connection => ZIO[R, Nothing, Any]], decoder: SocketDecoder, protocol: SocketProtocol)
Companion:
object
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Value members

Concrete methods

Creates a socket connection on the provided URL. Typically used to connect as a client.

Creates a socket connection on the provided URL. Typically used to connect as a client.

def onClose[R1 <: R](close: Connection => ZIO[R1, Nothing, Any]): SocketApp[R1]

Called when the websocket connection is closed successfully.

Called when the websocket connection is closed successfully.

def onError[R1 <: R](error: Throwable => ZIO[R1, Nothing, Any]): SocketApp[R1]

Called whenever there is an error on the channel after a successful upgrade to websocket.

Called whenever there is an error on the channel after a successful upgrade to websocket.

Called on every incoming WebSocketFrame. In case of a failure on the returned stream, the socket is forcefully closed.

Called on every incoming WebSocketFrame. In case of a failure on the returned stream, the socket is forcefully closed.

def onOpen[R1 <: R](open: Socket[R1, Throwable, Connection, WebSocketFrame]): SocketApp[R1]

Called when the connection is successfully upgraded to a websocket one. In case of a failure, the socket is forcefully closed.

Called when the connection is successfully upgraded to a websocket one. In case of a failure, the socket is forcefully closed.

def onOpen[R1 <: R](open: Connection => ZIO[R1, Throwable, Any]): SocketApp[R1]

Called when the connection is successfully upgraded to a websocket one. In case of a failure, the socket is forcefully closed.

Called when the connection is successfully upgraded to a websocket one. In case of a failure, the socket is forcefully closed.

def onTimeout[R1 <: R](timeout: ZIO[R1, Nothing, Any]): SocketApp[R1]

Called when the websocket handshake gets timeout.

Called when the websocket handshake gets timeout.

def provide(env: R)(implicit ev: NeedsEnv[R]): SocketApp[Any]

Provides the socket app with its required environment, which eliminates its dependency on R.

Provides the socket app with its required environment, which eliminates its dependency on R.

def toResponse: ZIO[R, Nothing, Response]

Creates a new response from the socket app.

Creates a new response from the socket app.

Frame decoder configuration

Frame decoder configuration

Server side websocket configuration

Server side websocket configuration

Inherited methods

Inherited from:
Product