Class SubmissionPublisher<T>

    • Constructor Detail

      • SubmissionPublisher

        public SubmissionPublisher​(Executor executor,
                                   int maxBufferCapacity)
        Deprecated.
        Creates a new SubmissionPublisher using the given Executor for async delivery to subscribers, with the given maximum buffer size for each subscriber.
        Parameters:
        executor - the executor to use for async delivery, supporting creation of at least one independent thread
        maxBufferCapacity - the maximum capacity for each subscriber's buffer
        Throws:
        IllegalArgumentException - if maxBufferCapacity not positive
      • SubmissionPublisher

        public SubmissionPublisher​(int maxBufferCapacity)
        Deprecated.
        Creates a new SubmissionPublisher using the current thread for delivery to subscribers, with the given maximum buffer size for each subscriber.
        Parameters:
        maxBufferCapacity - the maximum capacity for each subscriber's buffer
        Throws:
        IllegalArgumentException - if maxBufferCapacity not
      • SubmissionPublisher

        public SubmissionPublisher()
        Deprecated.
        Creates a new SubmissionPublisher using the current thread for delivery to subscribers, with maximum buffer capacity of Flow.defaultBufferSize().
    • Method Detail

      • submit

        public void submit​(T item)
        Deprecated.
        Publishes the given item to each current subscriber.
        Parameters:
        item - the (non-null) item to publish
        Throws:
        NullPointerException - if item is null
      • offer

        public void offer​(T item,
                          BiPredicate<Flow.Subscriber<? super T>,​? super T> onDrop)
        Deprecated.
        Publishes the given item to each current subscriber.
        Parameters:
        item - the (non-null) item to publish
        onDrop - not supported in the current implementation
        Throws:
        NullPointerException - if item is null
      • closeExceptionally

        public void closeExceptionally​(Throwable error)
        Deprecated.
        Unless already closed, issues onError signals to current subscribers with the given error, and disallows subsequent attempts to publish. Future subscribers also receive the given error. Upon return, this method does NOT guarantee that all subscribers have yet completed.
        Parameters:
        error - the onError argument sent to subscribers
        Throws:
        NullPointerException - if error is null
      • close

        public void close()
        Deprecated.
        Specified by:
        close in interface AutoCloseable
      • getNumberOfSubscribers

        public int getNumberOfSubscribers()
        Deprecated.
        Returns the number of current subscribers.
        Returns:
        the number of current subscribers
      • hasSubscribers

        public boolean hasSubscribers()
        Deprecated.
        Returns true if this publisher has any subscribers.
        Returns:
        true if this publisher has any subscribers