public abstract class WebSocket<A>
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
WebSocket.In<A>
A WebSocket in.
|
static interface |
WebSocket.Out<A>
A WebSocket out.
|
Constructor and Description |
---|
WebSocket() |
Modifier and Type | Method and Description |
---|---|
akka.actor.Props |
actorProps(akka.actor.ActorRef out)
The props to create the actor to handle this WebSocket.
|
boolean |
isActor()
If this method returns true, then the WebSocket should be handled by an actor.
|
abstract void |
onReady(WebSocket.In<A> in,
WebSocket.Out<A> out)
Called when the WebSocket is ready
|
static <A> WebSocket<A> |
reject(Result result)
Rejects a WebSocket.
|
Result |
rejectWith()
If this method returns a result, the WebSocket will be rejected with that result.
|
static <A> WebSocket<A> |
whenReady(F.Callback2<WebSocket.In<A>,WebSocket.Out<A>> callback)
Creates a WebSocket.
|
static <A> WebSocket<A> |
withActor(F.Function<akka.actor.ActorRef,akka.actor.Props> props)
Handles a WebSocket with an actor.
|
public abstract void onReady(WebSocket.In<A> in, WebSocket.Out<A> out)
in
- The Socket in.out
- The Socket out.public Result rejectWith()
public boolean isActor()
public akka.actor.Props actorProps(akka.actor.ActorRef out)
out
- The actor to send upstream messages to.public static <A> WebSocket<A> whenReady(F.Callback2<WebSocket.In<A>,WebSocket.Out<A>> callback)
onReady
method is
implemented using the specified Callback2<In<A>, Out<A>>
callback
- the callback used to implement onReadyjava.lang.NullPointerException
- if the specified callback is nullpublic static <A> WebSocket<A> reject(Result result)
result
- The result that will be returned.public static <A> WebSocket<A> withActor(F.Function<akka.actor.ActorRef,akka.actor.Props> props)
props
- The function used to create the props for the actor. The passed in argument is the upstream actor.