You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I find myself sometimes asking another Actor to produce a Flow for me. For instance, this is used heavily in this example: https://github.com/playframework/play-scala-websocket-example (native websockets). In this case, the method requires you to return a Future[Flow]:
/** * Creates an action that will either accept the websocket, using the given flow to handle the in and out stream, or * return a result to reject the Websocket.*/defacceptOrResult[In, Out](f: RequestHeader=>Future[Either[Result, Flow[In, Out, _]]])(implicittransformer: MessageFlowTransformer[In, Out]):WebSocket= {
WebSocket { request =>
f(request).map(_.right.map(transformer.transform))
}
}
Is it possible to use a similar pattern in this library or is it not relevant?
My other question is that is it possible to do some clean up actions? Something like onDisconnect?
Thanks for this library!
The text was updated successfully, but these errors were encountered:
Hi,
I find myself sometimes asking another Actor to produce a
Flow
for me. For instance, this is used heavily in this example: https://github.com/playframework/play-scala-websocket-example (native websockets). In this case, the method requires you to return aFuture[Flow]
:Is it possible to use a similar pattern in this library or is it not relevant?
My other question is that is it possible to do some clean up actions? Something like
onDisconnect
?Thanks for this library!
The text was updated successfully, but these errors were encountered: