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 newGeneratorPublisherwith the specified async generator. -
Method Summary
Modifier and TypeMethodDescriptionvoidsubscribe(Flow.Subscriber<? super T> subscriber) Subscribes the providedFlow.Subscriberto this signal.
-
Constructor Details
-
GeneratorPublisher
Constructs a newGeneratorPublisherwith the specified async generator.- Parameters:
delegate- The async generator to be used by this publisher.
-
-
Method Details
-
subscribe
Subscribes the providedFlow.Subscriberto this signal. The subscriber receives initial subscription, handles asynchronous data flow, and manages any errors or completion signals.- Specified by:
subscribein interfaceFlow.Publisher<T>- Parameters:
subscriber- The subscriber to which the signal will be delivered.
-