T
- arbitrary sequence typepublic static final class Hooks.OperatorHook<T>
extends java.lang.Object
Publisher
Modifier and Type | Method and Description |
---|---|
Hooks.OperatorHook<T> |
doOnEach(java.util.function.Consumer<? super T> onNextCall,
java.util.function.Consumer<? super java.lang.Throwable> onErrorCall,
java.lang.Runnable onCompleteCall,
java.lang.Runnable onAfterTerminateCall)
Peek into sequence signals.
|
Hooks.OperatorHook<T> |
doOnLifecycle(java.util.function.Consumer<? super org.reactivestreams.Subscription> onSubscribeCall,
java.util.function.LongConsumer onRequestCall,
java.lang.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(java.lang.String... names)
Apply hook only if
publisher() if operator name match the type name
(case insensitive, without Mono/Flux prefix or Fuseable suffix. |
Hooks.OperatorHook<T> |
ifNameContains(java.lang.String... names)
Apply hook only if
publisher() if operator name match the 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(java.lang.String category,
boolean showOperatorLine,
SignalType... options)
Observe Reactive Streams signals matching the passed filter
options and use
Logger support to handle trace implementation. |
Hooks.OperatorHook<T> |
log(java.lang.String category,
java.util.logging.Level level,
boolean showOperatorLine,
SignalType... options)
Observe Reactive Streams signals matching the passed filter
options and use
Logger support to handle trace implementation. |
Hooks.OperatorHook<T> |
log(java.lang.String category,
java.util.logging.Level level,
SignalType... options)
Observe Reactive Streams signals matching the passed filter
options and use
Logger support to handle trace implementation. |
Hooks.OperatorHook<T> |
log(java.lang.String category,
SignalType... options)
Observe Reactive Streams signals matching the passed filter
options and use
Logger support to handle trace implementation. |
Hooks.OperatorHook<T> |
operatorStacktrace()
Enable operator stack recorder and capture declaration stack.
|
org.reactivestreams.Publisher<T> |
publisher()
The current publisher to decorate
|
public final Hooks.OperatorHook<T> doOnEach(java.util.function.Consumer<? super T> onNextCall, java.util.function.Consumer<? super java.lang.Throwable> onErrorCall, java.lang.Runnable onCompleteCall, java.lang.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(java.util.function.Consumer<? super org.reactivestreams.Subscription> onSubscribeCall, java.util.function.LongConsumer onRequestCall, java.lang.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(java.lang.String... names)
publisher()
if operator name match the type name
(case insensitive, without Mono/Flux prefix or Fuseable suffix.names
- a list of possible names that can matchHooks.OperatorHook
public final Hooks.OperatorHook<T> ifNameContains(java.lang.String... names)
publisher()
if operator name match the type name
(case insensitive, without Mono/Flux prefix or Fuseable suffix.names
- a list of possible names that can matchHooks.OperatorHook
public Hooks.OperatorHook<T> log(java.lang.String category, SignalType... options)
options
and use
Logger
support to handle trace implementation. Default will use the
passed java.util.logging. 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(java.lang.String category, boolean showOperatorLine, SignalType... options)
options
and use
Logger
support to handle trace implementation. Default will use the
passed java.util.logging. 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(java.lang.String category, java.util.logging.Level level, SignalType... options)
options
and use
Logger
support to handle trace implementation. Default will use the passed
Level
and java.util.logging. 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(java.lang.String category, java.util.logging.Level level, boolean showOperatorLine, SignalType... options)
options
and use
Logger
support to handle trace implementation. Default will use the passed
Level
and java.util.logging. 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
public org.reactivestreams.Publisher<T> publisher()