public abstract class Hooks extends 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(Consumer<? super Throwable> c)
Override global error dropped strategy which by default bubble back the error.
|
static void |
onNextDropped(Consumer<Object> c)
Override global data dropped strategy which by default throw
Exceptions.failWithCancel() |
static <T> void |
onOperator(Function<? super Hooks.OperatorHook<T>,? extends Hooks.OperatorHook<T>> onOperator)
|
static void |
onOperatorError(BiFunction<? super Throwable,Object,? extends 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(Consumer<? super Throwable> c)
c
- the dropped error Consumer
hookpublic static void onNextDropped(Consumer<Object> c)
Exceptions.failWithCancel()
c
- the dropped next Consumer
hookpublic static <T> void onOperator(Function<? super Hooks.OperatorHook<T>,? extends Hooks.OperatorHook<T>> onOperator)
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 typeonOperator
- a callback for each assembly that must return an
Hooks.OperatorHook
querypublic static void onOperatorError(BiFunction<? super Throwable,Object,? extends 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()