A function that, given an actor to send upstream messages to, returns actor props to create an actor to handle the SockJS connection
Typeclass to handle SockJS message format.
Typeclass to handle SockJS message format.
Convert a text message sent from SockJS client into an A
Convert an A in a text message to be sent to SockJS client
Create a SockJS handler that will pass messages to/from the actor created by the given props.
Create a SockJS handler that will pass messages to/from the actor created by the given props.
Given a request and an actor ref to send messages to, the function passed should return the props for an actor to create to handle this SockJS connection.
For example:
def sockjs = SockJS.acceptWithActor[JsValue, JsValue] { req => out => MySockJSActor.props(out) }
Creates a SockJS handler that will adapt the incoming stream and send it back out.
Creates a SockJS handler that will either reject the connection with the given result, or will be handled by the given inbound and outbound channels, asynchronously
Create a SockJS handler that will pass messages to/from the actor created by the given props asynchronously.
Create a SockJS handler that will pass messages to/from the actor created by the given props asynchronously.
Given a request, this method should return a future of either:
- A result to reject the WebSocket with, or - A function that will take the sending actor, and create the props that describe the actor to handle this SockJS connection
For example:
def subscribe = SockJS.acceptWithActor[JsValue, JsValue] { req => val isAuthenticated: Future[Boolean] = authenticate(req) val isAuthenticated.map { case false => Left(Forbidden) case true => Right(MySockJSActor.props) } }
Accepts a SockJS connection using the given inbound/outbound channels.
Accepts a SockJS connection using the given inbound/outbound channels asynchronously.
Accepts a SockJS connection using the given inbound/outbound channels asynchronously.
(Since version 0.3) Use SockJS.tryAccept instead