public static interface Sinks.EmitFailureHandler
checking non-successful emission results from underlying
API calls to decide whether or not such calls should be retried.
Other than instructing to retry, the handlers are allowed to have side effects
like parking the current thread for longer retry loops. They don't, however, influence the
exact action taken by the emit API implementations when the handler doesn't allow
the retry to occur.
|Modifier and Type
|Field and Description
A pre-made handler that will not instruct to retry any failure and trigger the failure handling immediately.
static final Sinks.EmitFailureHandler FAIL_FAST
static Sinks.EmitFailureHandler busyLooping(Duration duration)
Sinks.EmitFailureHandler which will busy loop in case of concurrent use
of the sink (
Sinks.EmitResult.FAIL_NON_SERIALIZED, up to a deadline.
The deadline is computed immediately from the current time (construction time)
As a result there will always be some delay between this computation and the actual first
use of the handler (at a minimum, the time it takes for the first sink emission attempt).
Consider this when choosing the
Duration, and probably prefer something above 100ms,
and don't cache the returning handler for later usage.
boolean onEmitFailure(SignalType signalType, Sinks.EmitResult emitResult)
and the type of operation that was attempted (represented as a
Side effects are allowed.