Abstract implementation of MessageSink.
Management of demand for WebSocket frames may either be entirely managed
by the MessageSink implementation (autoDemand==true); or
it may be managed collaboratively between the application and the
MessageSink implementation (autoDemand==true).
MessageSink implementations must handle the demand for WebSocket
frames in this way:
autoDemand==false, the MessageSink manages the
demand until the conditions to invoke the application function are met;
when the MessageSink invokes the application function, then the
application is responsible to demand for more WebSocket frames.autoDemand==true, only the MessageSink manages the
demand for WebSocket frames. If the MessageSink invokes the application
function, the MessageSink must demand for WebSocket frames after the
invocation of the application function returns successfully.Method autoDemand() helps to manage the demand after the
invocation of the application function returns successfully.
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | |
| private final MethodHandle | |
| private final CoreSession |
| Access | Constructor and Description |
|---|---|
| public | AbstractMessageSink(CoreSession
the WebSocket session session, MethodHandle the application function to invoke methodHandle, boolean whether this autoDemand)MessageSink manages demand automatically
as explained in AbstractMessageSinkCreates a new |
| Modifier and Type | Method and Description |
|---|---|
| protected void | autoDemand()
If |
| public CoreSession | |
| public MethodHandle | |
| public boolean | isAutoDemand()
Returns: whether this |
| autoDemand | back to summary |
|---|---|
| private final boolean autoDemand | |
| methodHandle | back to summary |
|---|---|
| private final MethodHandle methodHandle | |
| session | back to summary |
|---|---|
| private final CoreSession session | |
| AbstractMessageSink | back to summary |
|---|---|
| public AbstractMessageSink(CoreSession session, MethodHandle methodHandle, boolean autoDemand) Creates a new
| |
| autoDemand | back to summary |
|---|---|
| protected void autoDemand() If | |
| getCoreSession | back to summary |
|---|---|
| public CoreSession getCoreSession() Get the WebSocket session.
| |
| getMethodHandle | back to summary |
|---|---|
| public MethodHandle getMethodHandle() Get the application function.
| |
| isAutoDemand | back to summary |
|---|---|
public boolean isAutoDemand()
| |