-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
room.websocket returning a WebSocket object #1
Comments
I see... What about providing a Room.async to hide it? WDYT? |
What type would return room.websocket in that case? If it returns (Iteratee, Enumerator), Room.async will do the same job as WebSocket.async, right? |
No I'd like to keep WebSocket as the return type... Something like: object Room {
def async[A]( fws: => Future[WebSocket[A]] )(implicit frameFormatter: WebSocket.FrameFormatter[A]) = {
WebSocket[A](h => (e, i) => {
fws onSuccess { case ws => ws.f(h)(e, i) }
})
}
} |
Oh ok I see, I didn't realize it was possible to do that. |
I wondered too but it is possible :D |
As room.websocket directly returns a WebSocket object, how can you deal with a futureRoom in your controller?
For example I want to keep a Map roomId -> room in an actor. In my controller, I want to retrieve a room according to its id:
Should we instead make room.websocket return a tuple (Iteratee, Enumerator), so that in this case we get a Future[(Iteratee, Enumerator)] which can be flattened or used with Websocket.async ?
The text was updated successfully, but these errors were encountered: