Package io.activej.csp.queue
Class ChannelBufferWithFallback<T>
java.lang.Object
io.activej.reactor.AbstractReactive
io.activej.reactor.ImplicitlyReactive
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>,io.activej.reactor.Reactive
public final class ChannelBufferWithFallback<T>
extends io.activej.reactor.ImplicitlyReactive
implements ChannelQueue<T>
-
Field Summary
Fields inherited from class io.activej.reactor.AbstractReactive
reactorFields inherited from interface io.activej.async.process.AsyncCloseable
STATIC -
Constructor Summary
ConstructorsConstructorDescriptionChannelBufferWithFallback(ChannelQueue<T> queue, Supplier<io.activej.promise.Promise<? extends ChannelQueue<T>>> bufferFactory) -
Method Summary
Methods inherited from class io.activej.reactor.AbstractReactive
getReactorMethods 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, transform
-
Constructor Details
-
ChannelBufferWithFallback
public ChannelBufferWithFallback(ChannelQueue<T> queue, Supplier<io.activej.promise.Promise<? extends ChannelQueue<T>>> bufferFactory)
-
-
Method Details
-
put
Description copied from interface:ChannelQueuePuts an item in the queue and returns apromiseofnullas a marker of completion.- Specified by:
putin interfaceChannelQueue<T>- Parameters:
item- a item passed to the queue- Returns:
promiseofnullas a marker of completion
-
take
Description copied from interface:ChannelQueueTakes an element of this queue and wraps it inpromise.- Specified by:
takein interfaceChannelQueue<T>- Returns:
- a
promiseof value from the queue
-
isSaturated
public boolean isSaturated()- Specified by:
isSaturatedin interfaceChannelQueue<T>
-
isExhausted
public boolean isExhausted()- Specified by:
isExhaustedin interfaceChannelQueue<T>
-
closeEx
- Specified by:
closeExin interfaceio.activej.async.process.AsyncCloseable
-
getException
-