Package io.activej.csp.queue
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>
-
Field Summary
Fields inherited from interface io.activej.async.process.AsyncCloseable
STATIC -
Method Summary
Modifier and TypeMethodDescriptionvoidstatic io.activej.promise.Promise<ChannelFileBuffer>static io.activej.promise.Promise<ChannelFileBuffer>@Nullable Exceptionbooleanbooleanio.activej.promise.Promise<Void>put(@Nullable io.activej.bytebuf.ByteBuf item) Puts an item in the queue and returns apromiseofnullas a marker of completion.io.activej.promise.Promise<io.activej.bytebuf.ByteBuf>take()Takes an element of this queue and wraps it inpromise.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.activej.async.process.AsyncCloseable
closeMethods inherited from interface io.activej.csp.queue.ChannelQueue
getConsumer, getConsumer, getSupplier, transform, transformMethods inherited from interface io.activej.common.initializer.WithInitializer
withInitializer
-
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
Description copied from interface:ChannelQueuePuts an item in the queue and returns apromiseofnullas a marker of completion.- Specified by:
putin interfaceChannelQueue<io.activej.bytebuf.ByteBuf>- Parameters:
item- a item passed to the queue- Returns:
promiseofnullas a marker of completion
-
take
public io.activej.promise.Promise<io.activej.bytebuf.ByteBuf> take()Description copied from interface:ChannelQueueTakes an element of this queue and wraps it inpromise.- Specified by:
takein interfaceChannelQueue<io.activej.bytebuf.ByteBuf>- Returns:
- a
promiseof value from the queue
-
isSaturated
public boolean isSaturated()- Specified by:
isSaturatedin interfaceChannelQueue<io.activej.bytebuf.ByteBuf>
-
isExhausted
public boolean isExhausted()- Specified by:
isExhaustedin interfaceChannelQueue<io.activej.bytebuf.ByteBuf>
-
closeEx
- Specified by:
closeExin interfaceio.activej.async.process.AsyncCloseable
-
getException
-