Package org.reactivestreams
Interface Publisher<T>
- Type Parameters:
T
- the type of element signaled
- All Known Subinterfaces:
Processor<T,
R>
- All Known Implementing Classes:
AsyncIterablePublisher
,FlowAdapters.ReactivePublisherFromFlow
,FlowAdapters.ReactiveToFlowProcessor
,HelperPublisher
,IdentityProcessorVerification.TestSetup
,InfiniteHelperPublisher
,InfiniteIncrementNumberPublisher
,NumberIterablePublisher
,RangePublisher
,SubscriberBlackboxVerification.BlackboxTestStage
,SubscriberWhiteboxVerification.WhiteboxTestStage
,TestEnvironment.ManualPublisher
public interface Publisher<T>
A
Publisher
is a provider of a potentially unbounded number of sequenced elements, publishing them according to
the demand received from its Subscriber
(s).
A Publisher
can serve multiple Subscriber
s subscribed subscribe(Subscriber)
dynamically
at various points in time.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
subscribe
(Subscriber<? super T> s) RequestPublisher
to start streaming data.
-
Method Details
-
subscribe
RequestPublisher
to start streaming data.This is a "factory method" and can be called multiple times, each time starting a new
Subscription
.Each
Subscription
will work for only a singleSubscriber
.A
Subscriber
should only subscribe once to a singlePublisher
.If the
Publisher
rejects the subscription attempt or otherwise fails it will signal the error viaSubscriber.onError(Throwable)
.- Parameters:
s
- theSubscriber
that will consume signals from thisPublisher
-