Class PushStreamProvider.PushEventPipe<T>

    • Constructor Summary

      Constructors 
      Constructor Description
      PushEventPipe()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long accept​(PushEvent<? extends T> event)
      Accept an event from a source.
      java.lang.AutoCloseable open​(PushEventConsumer<? super T> pec)
      Open the asynchronous channel between the source and the consumer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PushEventPipe

        PushEventPipe()
    • Method Detail

      • open

        public java.lang.AutoCloseable open​(PushEventConsumer<? super T> pec)
                                     throws java.lang.Exception
        Description copied from interface: PushEventSource
        Open the asynchronous channel between the source and the consumer. The call returns an AutoCloseable. This can be closed, and should close the channel, including sending a Close event if the channel was not already closed. The returned object must be able to be closed multiple times without sending more than one Close events.
        Specified by:
        open in interface PushEventSource<T>
        Parameters:
        pec - the consumer (not null)
        Returns:
        a AutoCloseable that can be used to close the stream
        Throws:
        java.lang.Exception
      • accept

        public long accept​(PushEvent<? extends T> event)
                    throws java.lang.Exception
        Description copied from interface: PushEventConsumer
        Accept an event from a source. Events can be delivered on multiple threads simultaneously. However, Close and Error events are the last events received, no more events must be sent after them.
        Specified by:
        accept in interface PushEventConsumer<T>
        Parameters:
        event - The event
        Returns:
        less than 0 means abort, 0 means continue, more than 0 means delay ms
        Throws:
        java.lang.Exception - to indicate that an error has occurred and that no further events should be delivered to this PushEventConsumer