Class ChannelFileBuffer

java.lang.Object
io.activej.csp.queue.ChannelFileBuffer
All Implemented Interfaces:
io.activej.async.process.AsyncCloseable, io.activej.common.initializer.WithInitializer<ChannelFileBuffer>, ChannelConsumerTransformer<io.activej.bytebuf.ByteBuf,ChannelConsumer<io.activej.bytebuf.ByteBuf>>, ChannelSupplierTransformer<io.activej.bytebuf.ByteBuf,ChannelSupplier<io.activej.bytebuf.ByteBuf>>, ChannelTransformer<io.activej.bytebuf.ByteBuf,io.activej.bytebuf.ByteBuf>, ChannelQueue<io.activej.bytebuf.ByteBuf>

public final class ChannelFileBuffer extends Object implements ChannelQueue<io.activej.bytebuf.ByteBuf>, io.activej.common.initializer.WithInitializer<ChannelFileBuffer>
  • Method Details

    • create

      public static io.activej.promise.Promise<ChannelFileBuffer> create(Executor executor, Path filePath)
    • create

      public static io.activej.promise.Promise<ChannelFileBuffer> create(Executor executor, Path path, @Nullable @Nullable io.activej.common.MemSize limit)
    • put

      public io.activej.promise.Promise<Void> put(@Nullable @Nullable io.activej.bytebuf.ByteBuf 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<io.activej.bytebuf.ByteBuf>
      Parameters:
      item - a item passed to the queue
      Returns:
      promise of null as a marker of completion
    • take

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

      public boolean isSaturated()
      Specified by:
      isSaturated in interface ChannelQueue<io.activej.bytebuf.ByteBuf>
    • isExhausted

      public boolean isExhausted()
      Specified by:
      isExhausted in interface ChannelQueue<io.activej.bytebuf.ByteBuf>
    • closeEx

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

      @Nullable public @Nullable Exception getException()