Interface ChannelSupplier<T>

All Superinterfaces:
io.activej.async.process.AsyncCloseable
All Known Implementing Classes:
AbstractChannelSupplier, ChannelFileReader, ChannelSuppliers.ChannelSupplierConcat, ChannelSuppliers.ChannelSupplierEmpty, ChannelSuppliers.ChannelSupplierOfException, ChannelSuppliers.ChannelSupplierOfIterator, ChannelSuppliers.ChannelSupplierOfValue

public interface ChannelSupplier<T> extends io.activej.async.process.AsyncCloseable
This interface represents supplier of Promise of data that should be used serially (each consecutive get()) operation should be called only after previous get() operation finishes.

After supplier is closed, all subsequent calls to get() will return promise, completed exceptionally.

If any exception is caught while supplying data items, AsyncCloseable.closeEx(Exception) method should be called. All resources should be freed and the caught exception should be propagated to all related processes.

If get() returns Promise of null, it represents end-of-stream and means that no additional data should be queried.