Interface SupervisedStream


  • public interface SupervisedStream
    Materialized 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.
    • 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.