Class GeneratorPublisher<T>

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>

public class GeneratorPublisher<T> extends Object implements Flow.Publisher<T>
A GeneratorPublisher is a Flow.Publisher that generates items from an asynchronous generator.
  • Constructor Details

    • GeneratorPublisher

      public GeneratorPublisher(AsyncGenerator<? extends T> delegate)
      Constructs a new GeneratorPublisher with the specified async generator.
      Parameters:
      delegate - The async generator to be used by this publisher.
  • Method Details

    • subscribe

      public void subscribe(Flow.Subscriber<? super T> subscriber)
      Subscribes the provided Flow.Subscriber to this signal. The subscriber receives initial subscription, handles asynchronous data flow, and manages any errors or completion signals.
      Specified by:
      subscribe in interface Flow.Publisher<T>
      Parameters:
      subscriber - The subscriber to which the signal will be delivered.