Top Description Inners Fields Constructors Methods
reactor.core.publisher

pack-priv final Class MonoDelay

extends Mono<Long>
implements Scannable, SourceProducer<Long>
Class Inheritance
All Implemented Interfaces
reactor.core.publisher.SourceProducer, org.reactivestreams.Publisher, reactor.core.Scannable
Imports
java.util.Objects, java.util.concurrent.RejectedExecutionException, .TimeUnit, java.util.concurrent.atomic.AtomicIntegerFieldUpdater, reactor.core.CoreSubscriber, .Disposable, .Exceptions, .Scannable, reactor.core.scheduler.Scheduler, reactor.util.annotation.Nullable

Emits a single 0L value delayed by some time amount with a help of a ScheduledExecutorService instance or a generic function callback that wraps other form of async-delayed execution of tasks.
See Also
Reactive-Streams-Commons

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
pack-priv static final String
pack-priv final long
pack-priv final Scheduler
pack-priv final TimeUnit
Inherited from reactor.core.publisher.Mono:
EQUALS_BIPREDICATE

Constructor Summary

AccessConstructor and Description
pack-priv
MonoDelay(long delay, TimeUnit unit, Scheduler timedScheduler)

Method Summary

Modifier and TypeMethod and Description
public Object
scanUnsafe(Scannable.Attr<T>
a Attr to resolve for the component.
key
)

Overrides default reactor.core.publisher.SourceProducer.scanUnsafe.

Implements reactor.core.Scannable.scanUnsafe.

This method is used internally by components to define their key-value mappings in a single place.
public void
subscribe(CoreSubscriber<? super Long>
the Subscriber interested into the published sequence
actual
)

Implements abstract reactor.core.publisher.Mono.subscribe.

Implements reactor.core.CorePublisher.subscribe.

An internal Publisher#subscribe(Subscriber) that will bypass Hooks#onLastOperator(Function) pointcut.
Inherited from reactor.core.publisher.Mono:
andasblockblockblockOptionalblockOptionalcachecachecachecachecachecacheInvalidateIfcacheInvalidateWhencacheInvalidateWhencancelOncastcheckpointcheckpointcheckpointconcatWithcontextCapturecontextWritecontextWritecreatedefaultIfEmptydeferdeferContextualdelaydelaydelayElementdelayElementdelaySubscriptiondelaySubscriptiondelaySubscriptiondelayUntildematerializedoAfterTerminatedoFinallydoFirstdoOnCanceldoOnDiscarddoOnEachdoOnErrordoOnErrordoOnErrordoOnNextdoOnRequestdoOnSignaldoOnSubscribedoOnSuccessdoOnTerminalSignaldoOnTerminateelapsedelapsedemptyemptyequalsBiPredicateerrorerrorexpandexpandexpandDeepexpandDeepfilterfilterWhenfirstfirstfirstWithSignalfirstWithSignalfirstWithValuefirstWithValueflatMapflatMapIterableflatMapManyflatMapManyfluxfromfromCallablefromCompletionStagefromCompletionStagefromDirectfromFuturefromFuturefromFuturefromFuturefromRunnablefromSupplierhandlehasElementhideignoreElementignoreElementsjustjustOrEmptyjustOrEmptyloglogloglogloglogmapmapNotNullmaterializemergeWithmetricsnameneverofTypeonAssemblyonErrorCompleteonErrorCompleteonErrorCompleteonErrorContinueonErrorContinueonErrorContinueonErrorMaponErrorMaponErrorMaponErrorResumeonErrorResumeonErrorResumeonErrorReturnonErrorReturnonErrorReturnonErrorStoponTerminateDetachorpublishpublishOnrepeatrepeatrepeatrepeatrepeatWhenrepeatWhenEmptyrepeatWhenEmptyretryretryretryWhensequenceEqualsequenceEqualsequenceEqualsharesinglesingleOptionalsubscribesubscribesubscribesubscribesubscribesubscribesubscribesubscribeOnsubscribeWithswitchIfEmptytagtaketaketakeUntilOthertaptaptapthenthenthenEmptythenManythenReturntimedtimedtimeouttimeouttimeouttimeouttimeouttimeouttimestamptimestamptoFuturetoStringtransformtransformDeferredtransformDeferredContextualusingusingusingWhenusingWhenwhenwhenwhenDelayErrorwhenDelayErrorwrapzipzipzipzipzipzipzipzipzipzipzipDelayErrorzipDelayErrorzipDelayErrorzipDelayErrorzipDelayErrorzipDelayErrorzipDelayErrorzipDelayErrorzipDelayErrorzipWhenzipWhenzipWithzipWith

Field Detail

CONTEXT_OPT_OUT_NOBACKPRESSUREback to summary
pack-priv static final String CONTEXT_OPT_OUT_NOBACKPRESSURE
delayback to summary
pack-priv final long delay
timedSchedulerback to summary
pack-priv final Scheduler timedScheduler
unitback to summary
pack-priv final TimeUnit unit

Constructor Detail

MonoDelayback to summary
pack-priv MonoDelay(long delay, TimeUnit unit, Scheduler timedScheduler)

Method Detail

scanUnsafeback to summary
public Object scanUnsafe(Scannable.Attr<T> key)

Overrides default reactor.core.publisher.SourceProducer.scanUnsafe.

Implements reactor.core.Scannable.scanUnsafe.

Doc from reactor.core.Scannable.scanUnsafe.

This method is used internally by components to define their key-value mappings in a single place. Although it is ignoring the generic type of the Attr key, implementors should take care to return values of the correct type, and return null if no specific value is available.

For public consumption of attributes, prefer using scan(Attr), which will return a typed value and fall back to the key's default if the component didn't define any mapping.

Parameters
key:Scannable.Attr<T>

a Attr to resolve for the component.

Returns:Object

the value associated to the key for that specific component, or null if none.

Annotations
@Override
subscribeback to summary
public void subscribe(CoreSubscriber<? super Long> actual)

Implements abstract reactor.core.publisher.Mono.subscribe.

Implements reactor.core.CorePublisher.subscribe.

Doc from reactor.core.publisher.Mono.subscribe.

An internal Publisher#subscribe(Subscriber) that will bypass Hooks#onLastOperator(Function) pointcut.

In addition to behave as expected by Publisher#subscribe(Subscriber) in a controlled manner, it supports direct subscribe-time Context passing.

Parameters
actual:CoreSubscriber<? super Long>

the Subscriber interested into the published sequence

Annotations
@Override
reactor.core.publisher back to summary

pack-priv final Class MonoDelay.MonoDelayRunnable

extends Object
implements Runnable, InnerProducer<Long>
Class Inheritance
All Implemented Interfaces
reactor.core.publisher.InnerProducer, org.reactivestreams.Subscription, reactor.core.Scannable, java.lang.Runnable

Field Summary

Modifier and TypeField and Description
pack-priv final CoreSubscriber<? super Long>
pack-priv Disposable
pack-priv final boolean
pack-priv static final byte
FLAG_CANCEL_SET

This bit indicates that a Disposable was set corresponding to the timer

pack-priv static final byte
FLAG_CANCELLED

This bit marks the subscription as cancelled

pack-priv static final byte
FLAG_DELAY_DONE

This bit indicates that the timer has expired

pack-priv static final byte
FLAG_PROPAGATED

This bit indicates that, following expiry of the timer AND request, onNext(0L) has been propagated downstream

pack-priv static final byte
FLAG_REQUESTED

This bit marks the subscription as requested (once)

pack-priv static final byte
FLAG_REQUESTED_EARLY

This bit indicates that a request happened before the delay timer was done (utility, especially in tests)

pack-priv volatile int
pack-priv static final AtomicIntegerFieldUpdater<MonoDelay.MonoDelayRunnable>

Constructor Summary

AccessConstructor and Description
pack-priv
MonoDelayRunnable(CoreSubscriber<? super Long> actual, boolean failOnBackpressure)

Method Summary

Modifier and TypeMethod and Description
public CoreSubscriber<? super Long>
public void
cancel()

Implements org.reactivestreams.Subscription.cancel.

Request the Publisher to stop sending data and clean up resources.
pack-priv static int
pack-priv static int
markCancelled(MonoDelay.MonoDelayRunnable instance)

Mark the subscriber has been cancelled.

pack-priv static int
markDelayDone(MonoDelay.MonoDelayRunnable instance)

Mark the delay has run out.

pack-priv static int
markPropagated(MonoDelay.MonoDelayRunnable instance)

Mark the operator has emitted the tick.

pack-priv static int
markRequested(MonoDelay.MonoDelayRunnable instance)

Mark the operator has been requested.

private void
public void
request(long
the strictly positive number of elements to requests to the upstream Publisher
n
)

Implements org.reactivestreams.Subscription.request.

No events will be sent by a Publisher until demand is signaled via this method.
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.
public Object
scanUnsafe(Scannable.Attr<T>
a Attr to resolve for the component.
key
)

Overrides default reactor.core.publisher.InnerProducer.scanUnsafe.

This method is used internally by components to define their key-value mappings in a single place.
pack-priv void
pack-priv static boolean

Returns:

true if the FLAG_CANCEL_SET bit is set on the given state
wasCancelFutureSet
(int state)

pack-priv static boolean

Returns:

true if the FLAG_CANCELLED bit is set on the given state
wasCancelled
(int state)

pack-priv static boolean

Returns:

true if the FLAG_DELAY_DONE bit is set on the given state
wasDelayDone
(int state)

pack-priv static boolean

Returns:

true if the FLAG_PROPAGATED bit is set on the given state
wasPropagated
(int state)

pack-priv static boolean

Returns:

true if the FLAG_REQUESTED bit is set on the given state
wasRequested
(int state)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

actualback to summary
pack-priv final CoreSubscriber<? super Long> actual
cancelback to summary
pack-priv Disposable cancel
failOnBackpressureback to summary
pack-priv final boolean failOnBackpressure
FLAG_CANCEL_SETback to summary
pack-priv static final byte FLAG_CANCEL_SET

This bit indicates that a Disposable was set corresponding to the timer

FLAG_CANCELLEDback to summary
pack-priv static final byte FLAG_CANCELLED

This bit marks the subscription as cancelled

FLAG_DELAY_DONEback to summary
pack-priv static final byte FLAG_DELAY_DONE

This bit indicates that the timer has expired

FLAG_PROPAGATEDback to summary
pack-priv static final byte FLAG_PROPAGATED

This bit indicates that, following expiry of the timer AND request, onNext(0L) has been propagated downstream

FLAG_REQUESTEDback to summary
pack-priv static final byte FLAG_REQUESTED

This bit marks the subscription as requested (once)

FLAG_REQUESTED_EARLYback to summary
pack-priv static final byte FLAG_REQUESTED_EARLY

This bit indicates that a request happened before the delay timer was done (utility, especially in tests)

stateback to summary
pack-priv volatile int state
STATEback to summary
pack-priv static final AtomicIntegerFieldUpdater<MonoDelay.MonoDelayRunnable> STATE

Constructor Detail

MonoDelayRunnableback to summary
pack-priv MonoDelayRunnable(CoreSubscriber<? super Long> actual, boolean failOnBackpressure)

Method Detail

actualback to summary
public CoreSubscriber<? super Long> actual()

Implements reactor.core.publisher.InnerProducer.actual.

Annotations
@Override
cancelback to summary
public void cancel()

Implements org.reactivestreams.Subscription.cancel.

Doc from org.reactivestreams.Subscription.cancel.

Request the Publisher to stop sending data and clean up resources.

Data may still be sent to meet previously signalled demand after calling cancel.

Annotations
@Override
markCancelFutureSetback to summary
pack-priv static int markCancelFutureSet(MonoDelay.MonoDelayRunnable instance)

Mark that the cancel Disposable was set from the java.util.concurrent.Future. Immediately returns if it was cancelled or if the disposable was already set.

markCancelledback to summary
pack-priv static int markCancelled(MonoDelay.MonoDelayRunnable instance)

Mark the subscriber has been cancelled. Immediately returns if it was already cancelled.

markDelayDoneback to summary
pack-priv static int markDelayDone(MonoDelay.MonoDelayRunnable instance)

Mark the delay has run out. Immediately returns if it was already cancelled or already marked as done.

markPropagatedback to summary
pack-priv static int markPropagated(MonoDelay.MonoDelayRunnable instance)

Mark the operator has emitted the tick. Immediately returns if it was already cancelled.

markRequestedback to summary
pack-priv static int markRequested(MonoDelay.MonoDelayRunnable instance)

Mark the operator has been requested. Immediately returns if it was already cancelled or already requested. Also sets the FLAG_REQUESTED_EARLY flag if the delay was already done when request happened.

propagateDelayback to summary
private void propagateDelay()
requestback to summary
public void request(long n)

Implements org.reactivestreams.Subscription.request.

Doc from org.reactivestreams.Subscription.request.

No events will be sent by a Publisher until demand is signaled via this method.

It can be called however often and whenever needed—but if the outstanding cumulative demand ever becomes Long.MAX_VALUE or more, it may be treated by the Publisher as "effectively unbounded".

Whatever has been requested can be sent by the Publisher so only signal demand for what can be safely handled.

A Publisher can send less than is requested if the stream ends but then must emit either Subscriber#onError(Throwable) or Subscriber#onComplete().

Parameters
n:long

the strictly positive number of elements to requests to the upstream Publisher

Annotations
@Override
runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override
scanUnsafeback to summary
public Object scanUnsafe(Scannable.Attr<T> key)

Overrides default reactor.core.publisher.InnerProducer.scanUnsafe.

Doc from reactor.core.Scannable.scanUnsafe.

This method is used internally by components to define their key-value mappings in a single place. Although it is ignoring the generic type of the Attr key, implementors should take care to return values of the correct type, and return null if no specific value is available.

For public consumption of attributes, prefer using scan(Attr), which will return a typed value and fall back to the key's default if the component didn't define any mapping.

Parameters
key:Scannable.Attr<T>

a Attr to resolve for the component.

Returns:Object

the value associated to the key for that specific component, or null if none.

Annotations
@Override
@Nullable
setCancelback to summary
pack-priv void setCancel(Disposable cancel)
wasCancelFutureSetback to summary
pack-priv static boolean wasCancelFutureSet(int state)
Returns:boolean

true if the FLAG_CANCEL_SET bit is set on the given state

wasCancelledback to summary
pack-priv static boolean wasCancelled(int state)
Returns:boolean

true if the FLAG_CANCELLED bit is set on the given state

wasDelayDoneback to summary
pack-priv static boolean wasDelayDone(int state)
Returns:boolean

true if the FLAG_DELAY_DONE bit is set on the given state

wasPropagatedback to summary
pack-priv static boolean wasPropagated(int state)
Returns:boolean

true if the FLAG_PROPAGATED bit is set on the given state

wasRequestedback to summary
pack-priv static boolean wasRequested(int state)
Returns:boolean

true if the FLAG_REQUESTED bit is set on the given state