Interface SupervisedStream
-
public interface SupervisedStreamMaterialized value of a source queue for supervision of the stream for which the queue is a part. Provides a kill switch and a termination future.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classSupervisedStream.WithQueueMaterialized value containing aSourceQueueand aSupervisedSource.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description voidabort(Throwable error)Abort the supervised stream with an error.voidshutdown()Shutdown the supervised stream.static akka.stream.javadsl.Source<SessionedJsonifiable,SupervisedStream.WithQueue>sourceQueue(int queueSize)Create a source queue that materializes an additional value for supervision.voidwhenComplete(Consumer<? super Throwable> errorConsumer)Add a listener for stream termination.
-
-
-
Method Detail
-
sourceQueue
static akka.stream.javadsl.Source<SessionedJsonifiable,SupervisedStream.WithQueue> sourceQueue(int queueSize)
Create a source queue that materializes an additional value for supervision.- Parameters:
queueSize- size of the source queue.- Returns:
- the source queue.
-
whenComplete
void whenComplete(Consumer<? super Throwable> errorConsumer)
Add a listener for stream termination.- Parameters:
errorConsumer- called when the stream terminates. The argument is null after a normal termination or an error after an abnormal termination.
-
shutdown
void shutdown()
Shutdown the supervised stream.
-
abort
void abort(Throwable error)
Abort the supervised stream with an error.- Parameters:
error- the error with which to fail the stream.
-
-