public class SubmissionPublisherFactory extends Object
Constructor and Description |
---|
SubmissionPublisherFactory() |
Modifier and Type | Method and Description |
---|---|
static <T> SubmittableFlowPublisher<T> |
createSubmissionPublisher()
Creates a new SubmittableFlowPublisher using the
ForkJoinPool.commonPool() for async delivery to subscribers
(unless it does not support a parallelism level of at least two,
in which case, a new Thread is created to run each task), with
maximum buffer capacity of Flow.defaultBufferSize() , and no
handler for Subscriber exceptions in method onNext . |
static <T> SubmittableFlowPublisher<T> |
createSubmissionPublisher(Executor executor,
int maxBufferCapacity)
Creates a new Jdk9SubmissionPublisher using the given Executor for
async delivery to subscribers, with the given maximum buffer size
for each subscriber, and no handler for Subscriber exceptions in
method
onNext . |
static <T> SubmittableFlowPublisher<T> |
createSubmissionPublisher(Executor executor,
int maxBufferCapacity,
BiConsumer<? super Flow.Subscriber<? super T>,? super Throwable> handler)
Creates a new SubmittableFlowPublisher using the given Executor for
async delivery to subscribers, with the given maximum buffer size
for each subscriber, and, if non-null, the given handler invoked
when any Subscriber throws an exception in method
onNext . |
public static <T> SubmittableFlowPublisher<T> createSubmissionPublisher()
ForkJoinPool.commonPool()
for async delivery to subscribers
(unless it does not support a parallelism level of at least two,
in which case, a new Thread is created to run each task), with
maximum buffer capacity of Flow.defaultBufferSize()
, and no
handler for Subscriber exceptions in method onNext
.public static <T> SubmittableFlowPublisher<T> createSubmissionPublisher(Executor executor, int maxBufferCapacity)
onNext
.executor
- the executor to use for async delivery,
supporting creation of at least one independent threadmaxBufferCapacity
- the maximum capacity for each
subscriber's buffer (the enforced capacity may be rounded up to
the nearest power of two and/or bounded by the largest value
supported by this implementation; method #getMaxBufferCapacity
returns the actual value)NullPointerException
- if executor is nullIllegalArgumentException
- if maxBufferCapacity not
positivepublic static <T> SubmittableFlowPublisher<T> createSubmissionPublisher(Executor executor, int maxBufferCapacity, BiConsumer<? super Flow.Subscriber<? super T>,? super Throwable> handler)
onNext
.executor
- the executor to use for async delivery,
supporting creation of at least one independent threadmaxBufferCapacity
- the maximum capacity for each
subscriber's buffer (the enforced capacity may be rounded up to
the nearest power of two and/or bounded by the largest value
supported by this implementation; method #getMaxBufferCapacity
returns the actual value)handler
- if non-null, procedure to invoke upon exception
thrown in method onNext
NullPointerException
- if executor is nullIllegalArgumentException
- if maxBufferCapacity not
positiveCopyright © 2007-2024, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.