Class ChannelBufferWithFallback<T>

java.lang.Object
io.activej.csp.queue.ChannelBufferWithFallback<T>
All Implemented Interfaces:
io.activej.async.process.AsyncCloseable, ChannelConsumerTransformer<T,ChannelConsumer<T>>, ChannelSupplierTransformer<T,ChannelSupplier<T>>, ChannelTransformer<T,T>, ChannelQueue<T>

public final class ChannelBufferWithFallback<T> extends Object implements ChannelQueue<T>
  • Constructor Details

  • Method Details

    • put

      public io.activej.promise.Promise<Void> put(@Nullable T item)
      Description copied from interface: ChannelQueue
      Puts an item in the queue and returns a promise of null as a marker of completion.
      Specified by:
      put in interface ChannelQueue<T>
      Parameters:
      item - a item passed to the queue
      Returns:
      promise of null as a marker of completion
    • take

      public io.activej.promise.Promise<T> take()
      Description copied from interface: ChannelQueue
      Takes an element of this queue and wraps it in promise.
      Specified by:
      take in interface ChannelQueue<T>
      Returns:
      a promise of value from the queue
    • doTake

      public io.activej.promise.Promise<T> doTake()
    • isSaturated

      public boolean isSaturated()
      Specified by:
      isSaturated in interface ChannelQueue<T>
    • isExhausted

      public boolean isExhausted()
      Specified by:
      isExhausted in interface ChannelQueue<T>
    • closeEx

      public void closeEx(@NotNull @NotNull Exception e)
      Specified by:
      closeEx in interface io.activej.async.process.AsyncCloseable
    • getException

      @Nullable public @Nullable Exception getException()