public class CallBackEventSource<T>
extends java.lang.Object
SimplePushEventSource that has certain callback methods on SimplePushEventSource#open(PushEventConsumer), SimplePushEventSource#close().
It also provides a Callback, after a PushEventConsumer received its close event| Constructor and Description |
|---|
CallBackEventSource(<any> root,
java.util.function.BiConsumer<CallBackEventSource<T>,<any>> openCallBack,
java.util.function.Consumer<CallBackEventSource<T>> closeCallback,
java.util.function.BiConsumer<CallBackEventSource<T>,<any>> consumerClosedCallback)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
<any> |
connectPromise() |
void |
endOfStream() |
void |
error(java.lang.Throwable t) |
boolean |
isConnected() |
java.lang.AutoCloseable |
open(<any> aec) |
void |
publish(T t) |
public CallBackEventSource(<any> root,
java.util.function.BiConsumer<CallBackEventSource<T>,<any>> openCallBack,
java.util.function.Consumer<CallBackEventSource<T>> closeCallback,
java.util.function.BiConsumer<CallBackEventSource<T>,<any>> consumerClosedCallback)
root - the SimplePushEventSource every call gets delegated toopenCallBack - this function is called every time SimplePushEventSource#open(PushEventConsumer) is calledcloseCallback - will be called before the source close will be calledconsumerClosedCallback - will be called after the close event was send to a consumerpublic void close()
public void endOfStream()
public void error(java.lang.Throwable t)
public boolean isConnected()
public <any> connectPromise()
public java.lang.AutoCloseable open(<any> aec)
throws java.lang.Exception
java.lang.Exceptionpublic void publish(T t)
Data In Motion Consulting GmbH