@Deprecated public abstract class LegacyEventSource extends Results.Chunks<java.lang.String>
Modifier and Type | Class and Description |
---|---|
static class |
LegacyEventSource.Event
Deprecated.
Utility class to build events.
|
Results.Chunks.Out<A>
Constructor and Description |
---|
LegacyEventSource()
Deprecated.
Create a new LegacyEventSource socket
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Deprecated.
Close the channel
|
abstract void |
onConnected()
Deprecated.
The socket is ready, you can start sending messages.
|
void |
onDisconnected(java.lang.Runnable callback)
Deprecated.
Add a callback to be notified when the client has disconnected.
|
void |
onReady(Results.Chunks.Out<java.lang.String> out)
Deprecated.
Called when the Chunked stream is ready.
|
void |
send(LegacyEventSource.Event event)
Deprecated.
Send an event.
|
static LegacyEventSource |
whenConnected(java.util.function.Consumer<LegacyEventSource> callback)
Deprecated.
Creates an LegacyEventSource.
|
public LegacyEventSource()
public void onReady(Results.Chunks.Out<java.lang.String> out)
Results.Chunks
onReady
in class Results.Chunks<java.lang.String>
out
- The out stream.public void send(LegacyEventSource.Event event)
event
- Event contentpublic abstract void onConnected()
public void onDisconnected(java.lang.Runnable callback)
public void close()
public static LegacyEventSource whenConnected(java.util.function.Consumer<LegacyEventSource> callback)
onConnected
method is
implemented using the specified F.Callback<LegacyEventSource>
and
is invoked with LegacyEventSource.this
.callback
- the callback used to implement onConnectedjava.lang.NullPointerException
- if the specified callback is null