Package io.helidon.common.reactive
Class SubmissionPublisher<T>
- java.lang.Object
-
- io.helidon.common.reactive.SubmissionPublisher<T>
-
- Type Parameters:
T
- the published item type
- All Implemented Interfaces:
Flow.Publisher<T>
,AutoCloseable
@Deprecated public class SubmissionPublisher<T> extends Object implements Flow.Publisher<T>, AutoCloseable
Deprecated.This class will be removed in the next major release.AFlow.Publisher
that asynchronously issues submitted (non-null) items to current subscribers until it is closed.
-
-
Constructor Summary
Constructors Constructor Description SubmissionPublisher()
Deprecated.Creates a new SubmissionPublisher using the current thread for delivery to subscribers, with maximum buffer capacity ofFlow.defaultBufferSize()
.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.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.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
close()
Deprecated.void
closeExceptionally(Throwable error)
Deprecated.Unless already closed, issuesonError
signals to current subscribers with the given error, and disallows subsequent attempts to publish.int
getNumberOfSubscribers()
Deprecated.Returns the number of current subscribers.boolean
hasSubscribers()
Deprecated.Returns true if this publisher has any subscribers.void
offer(T item, BiPredicate<Flow.Subscriber<? super T>,? super T> onDrop)
Deprecated.Publishes the given item to each current subscriber.void
submit(T item)
Deprecated.Publishes the given item to each current subscriber.void
subscribe(Flow.Subscriber<? super T> subscriber)
Deprecated.Adds the given Subscriber.
-
-
-
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 threadmaxBufferCapacity
- 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 ofFlow.defaultBufferSize()
.
-
-
Method Detail
-
subscribe
public void subscribe(Flow.Subscriber<? super T> subscriber)
Deprecated.Adds the given Subscriber.- Specified by:
subscribe
in interfaceFlow.Publisher<T>
- Parameters:
subscriber
- the subscriber- Throws:
NullPointerException
- if subscriber is null
-
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 publishonDrop
- not supported in the current implementation- Throws:
NullPointerException
- if item is null
-
closeExceptionally
public void closeExceptionally(Throwable error)
Deprecated.Unless already closed, issuesonError
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
- theonError
argument sent to subscribers- Throws:
NullPointerException
- if error is null
-
close
public void close()
Deprecated.- Specified by:
close
in interfaceAutoCloseable
-
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
-
-