Class ChannelSuppliers.ChannelSupplierOfIterator<T>

java.lang.Object
io.activej.async.process.AbstractAsyncCloseable
io.activej.csp.AbstractChannelSupplier<T>
io.activej.csp.ChannelSuppliers.ChannelSupplierOfIterator<T>
All Implemented Interfaces:
io.activej.async.process.AsyncCloseable, ChannelSupplier<T>
Enclosing class:
ChannelSuppliers

public static final class ChannelSuppliers.ChannelSupplierOfIterator<T> extends AbstractChannelSupplier<T>
Represents a ChannelSupplier which wraps the provided iterator and returns promises of iterator's values until hasNext() is true, when there are no more values left, a promise of null is returned.
  • Constructor Details

    • ChannelSupplierOfIterator

      public ChannelSupplierOfIterator(Iterator<? extends T> iterator, boolean ownership)
  • Method Details

    • doGet

      protected io.activej.promise.Promise<T> doGet()
      Specified by:
      doGet in class AbstractChannelSupplier<T>
    • onCleanup

      protected void onCleanup()
      Overrides:
      onCleanup in class io.activej.async.process.AbstractAsyncCloseable