java.lang.Object
org.bsc.async.internal.reactive.GeneratorPublisher<T>
- Type Parameters:
T
- the type of items to be published
- All Implemented Interfaces:
Flow.Publisher<T>
A
GeneratorPublisher
is a Flow.Publisher
that
generates items from an asynchronous generator.-
Constructor Summary
ConstructorsConstructorDescriptionGeneratorPublisher
(AsyncGenerator<? extends T> delegate) Constructs a newGeneratorPublisher
with the specified async generator. -
Method Summary
Modifier and TypeMethodDescriptionvoid
subscribe
(Flow.Subscriber<? super T> subscriber) Subscribes the providedFlow.Subscriber
to this signal.
-
Constructor Details
-
GeneratorPublisher
Constructs a newGeneratorPublisher
with the specified async generator.- Parameters:
delegate
- The async generator to be used by this publisher.
-
-
Method Details
-
subscribe
Subscribes the providedFlow.Subscriber
to this signal. The subscriber receives initial subscription, handles asynchronous data flow, and manages any errors or completion signals.- Specified by:
subscribe
in interfaceFlow.Publisher<T>
- Parameters:
subscriber
- The subscriber to which the signal will be delivered.
-