Modifier and Type | Method and Description |
---|---|
Hooks.OperatorHook<T> |
doOnEach(Consumer<? super T> onNextCall,
Consumer<? super Throwable> onErrorCall,
Runnable onCompleteCall,
Runnable onAfterTerminateCall)
Peek into sequence signals.
|
Hooks.OperatorHook<T> |
doOnLifecycle(Consumer<? super Subscription> onSubscribeCall,
LongConsumer onRequestCall,
Runnable onCancelCall)
Peek into lifecycle signals.
|
Hooks.OperatorHook<T> |
ifFlux()
Apply hook only if
publisher() is Flux |
Hooks.OperatorHook<T> |
ifMono()
Apply hook only if
publisher() is Mono |
Hooks.OperatorHook<T> |
ifName(String... names)
Apply hook only if one of the provided names matches the
operator underlying type name (case insensitive, without Mono/Flux prefix
or Fuseable suffix).
|
Hooks.OperatorHook<T> |
ifNameContains(String... names)
Apply hook only if one of the provided names is contained in the
operator's underlying type name (case insensitive, without Mono/Flux prefix
or Fuseable suffix).
|
Hooks.OperatorHook<T> |
ifParallelFlux()
Apply hook only if
publisher() is ParallelFlux |
Hooks.OperatorHook<T> |
ignore()
Discard all
Hooks.OperatorHook applied to the current publisher() |
Hooks.OperatorHook<T> |
log(String category,
boolean showOperatorLine,
SignalType... options)
Observe Reactive Streams signals matching the passed filter
options and
log them at INFO level. |
Hooks.OperatorHook<T> |
log(String category,
Level level,
boolean showOperatorLine,
SignalType... options)
Observe Reactive Streams signals matching the passed filter
options and
log them at the provided level. |
Hooks.OperatorHook<T> |
log(String category,
Level level,
SignalType... options)
Observe Reactive Streams signals matching the passed filter
options and
log them at the provided level. |
Hooks.OperatorHook<T> |
log(String category,
SignalType... options)
Observe Reactive Streams signals matching the passed filter
options and
log them at INFO level. |
Hooks.OperatorHook<T> |
operatorStacktrace()
Enable operator stack recorder that captures a declaration stack whenever an
operator is instantiated.
|
Publisher<T> |
publisher()
The publisher being decorated
|
public final Hooks.OperatorHook<T> doOnEach(Consumer<? super T> onNextCall, Consumer<? super Throwable> onErrorCall, Runnable onCompleteCall, Runnable onAfterTerminateCall)
The callbacks are all optional.
onNextCall
- A consumer that will observe Subscriber.onNext(Object)
onErrorCall
- A consumer that will observe Subscriber.onError(Throwable)
}onCompleteCall
- A task that will run on Subscriber.onComplete()
onAfterTerminateCall
- A task will run after termination via Subscriber.onComplete()
or Subscriber.onError(Throwable)
Hooks.OperatorHook
public final Hooks.OperatorHook<T> doOnLifecycle(Consumer<? super Subscription> onSubscribeCall, LongConsumer onRequestCall, Runnable onCancelCall)
The callbacks are all optional.
onSubscribeCall
- A consumer that will observe Subscriber.onSubscribe(Subscription)
onRequestCall
- A consumer of long that will observe Subscription.request(long)
}onCancelCall
- A task that will run on Subscription.cancel()
Hooks.OperatorHook
public final Hooks.OperatorHook<T> ignore()
Hooks.OperatorHook
applied to the current publisher()
Hooks.OperatorHook
public final Hooks.OperatorHook<T> ifFlux()
publisher()
is Flux
Hooks.OperatorHook
public final Hooks.OperatorHook<T> ifMono()
publisher()
is Mono
Hooks.OperatorHook
public final Hooks.OperatorHook<T> ifParallelFlux()
publisher()
is ParallelFlux
Hooks.OperatorHook
public final Hooks.OperatorHook<T> ifName(String... names)
names
- a list of possible names that would match if equalHooks.OperatorHook
public final Hooks.OperatorHook<T> ifNameContains(String... names)
names
- a list of possible names that would match if containedHooks.OperatorHook
public Hooks.OperatorHook<T> log(String category, SignalType... options)
options
and
log them at INFO level.
Logging it done through Logger
so the default logging framework is
java.util.logging
, but if SLF4J is available it will be used instead.
Options allow fine grained filtering of the traced signal, for instance to only capture onNext and onError:
Operators.signalLogger(source, "category", Level.INFO, SignalType.ON_NEXT, SignalType.ON_ERROR)
category
- to be mapped into logger configuration (e.g.
org.springframework.reactor). If category is null, empty or ends with "." like
"reactor.", a generated operator suffix will complete, e.g. "reactor.Flux.Map".options
- a vararg SignalType
option to filter log messagesHooks.OperatorHook
public Hooks.OperatorHook<T> log(String category, boolean showOperatorLine, SignalType... options)
options
and
log them at INFO level.
Logging it done through Logger
so the default logging framework is
java.util.logging
, but if SLF4J is available it will be used instead.
Options allow fine grained filtering of the traced signal, for instance to only capture onNext and onError:
Operators.signalLogger(source, "category", Level.INFO, SignalType.ON_NEXT, SignalType.ON_ERROR)
category
- to be mapped into logger configuration (e.g.
org.springframework.reactor). If category is null, empty or ends with "." like
"reactor.", a generated operator suffix will complete, e.g. "reactor.Flux.Map".showOperatorLine
- capture the current stack to display operator
class/line number.options
- a vararg SignalType
option to filter log messagesHooks.OperatorHook
public Hooks.OperatorHook<T> log(String category, Level level, SignalType... options)
options
and
log them at the provided level.
Logging it done through Logger
so the default logging framework is
java.util.logging
, but if SLF4J is available it will be used instead.
Options allow fine grained filtering of the traced signal, for instance to only capture onNext and onError:
Operators.signalLogger(source, "category", Level.INFO, SignalType.ON_NEXT, SignalType.ON_ERROR)
category
- to be mapped into logger configuration (e.g.
org.springframework.reactor). If category is null, empty or ends with "." like
"reactor.", a generated operator suffix will complete, e.g. "reactor.Flux.Map".level
- the level to enforce for this tracing Fluxoptions
- a vararg SignalType
option to filter log messagesHooks.OperatorHook
public Hooks.OperatorHook<T> log(String category, Level level, boolean showOperatorLine, SignalType... options)
options
and
log them at the provided level.
Logging it done through Logger
so the default logging framework is
java.util.logging
, but if SLF4J is available it will be used instead.
Options allow fine grained filtering of the traced signal, for instance to only capture onNext and onError:
Operators.signalLogger(source, "category", Level.INFO, SignalType.ON_NEXT, SignalType.ON_ERROR)
category
- to be mapped into logger configuration (e.g.
org.springframework.reactor). If category is null, empty or ends with "." like
"reactor.", a generated operator suffix will complete, e.g. "reactor.Flux.Map".level
- the level to enforce for this tracing FluxshowOperatorLine
- capture the current stack to display operator
class/line number.options
- a vararg SignalType
option to filter log messagesHooks.OperatorHook
public Hooks.OperatorHook<T> operatorStacktrace()
Hooks.OperatorHook