public abstract class Hooks
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Hooks.OperatorHook<T>
Filtering and Handling options to apply on a given
Publisher |
Modifier and Type | Method and Description |
---|---|
static void |
onErrorDropped(java.util.function.Consumer<? super java.lang.Throwable> c)
Override global error dropped strategy which by default bubble back the error.
|
static void |
onNextDropped(java.util.function.Consumer<java.lang.Object> c)
Override global data dropped strategy which by default throw
Exceptions.failWithCancel() |
static <T> void |
onOperator(java.util.function.Function<? super Hooks.OperatorHook<T>,? extends Hooks.OperatorHook<T>> newHook)
|
static void |
onOperatorError(java.util.function.BiFunction<? super java.lang.Throwable,java.lang.Object,? extends java.lang.Throwable> f)
Override global operator error mapping which by default add as suppressed exception
either data driven exception or error driven exception.
|
static void |
resetOnErrorDropped()
Reset global error dropped strategy to bubbling back the error.
|
static void |
resetOnNextDropped()
Reset global data dropped strategy to throwing via
Exceptions.failWithCancel() |
static void |
resetOnOperator()
Reset global "assembly" hook tracking
|
static void |
resetOnOperatorError()
Reset global operator error mapping to adding as suppressed exception either data
driven exception or error driven exception.
|
public static void onErrorDropped(java.util.function.Consumer<? super java.lang.Throwable> c)
c
- the dropped error Consumer
hookpublic static void onNextDropped(java.util.function.Consumer<java.lang.Object> c)
Exceptions.failWithCancel()
c
- the dropped next Consumer
hookpublic static <T> void onOperator(java.util.function.Function<? super Hooks.OperatorHook<T>,? extends Hooks.OperatorHook<T>> newHook)
Publisher
(Flux
or Mono
). The passed function must result in a
value different from null, and Hooks.OperatorHook.ignore()
can be used to discard
a specific Publisher
from transformations.
Can be reset via resetOnOperator()
T
- the arbitrary assembled sequence typenewHook
- a callback for each assembly that must return a SignalPeek
public static void onOperatorError(java.util.function.BiFunction<? super java.lang.Throwable,java.lang.Object,? extends java.lang.Throwable> f)
f
- the operator error BiFunction
mapper, given the failure and an
eventual original context (data or error) and returning an arbitrary exception.public static void resetOnErrorDropped()
public static void resetOnNextDropped()
Exceptions.failWithCancel()
public static void resetOnOperator()
public static void resetOnOperatorError()