C - Context type that is returned from start and passed to either complete or error.public abstract class DebugNotificationListener<C>
extends java.lang.Object
DebugHook to receive notification
about all activity in Rx.DebugHook| Constructor and Description |
|---|
DebugNotificationListener() |
| Modifier and Type | Method and Description |
|---|---|
void |
complete(C context)
After the actual operations has completed from
DebugNotificationListener.start(DebugNotification) this is
invoked |
void |
error(C context,
java.lang.Throwable e)
After the actual operations has thrown an exception from
DebugNotificationListener.start(DebugNotification)
this is invoked |
<T> T |
onNext(DebugNotification<T> n)
Override this to change the default behavior of returning the encapsulated value.
|
<T> C |
start(DebugNotification<T> n)
For each
DebugNotification.Kind start is invoked before the actual method is invoked. |
public <T> T onNext(DebugNotification<T> n)
DebugNotification.getKind() is
DebugNotification.Kind.OnNext and the value (null or not) is just about to be sent to
next Observer. This can end up being called multiple times for
the same value as it passes from Observable.Operator to Observable.Operator in the
Observable chain.
This can be used to decorate or replace the values passed into any onNext function or just perform extra logging, metrics and other such things and pass-thru the function.
n - DebugNotification containing the data and context about what is happening.public <T> C start(DebugNotification<T> n)
DebugNotification.Kind start is invoked before the actual method is invoked.
This can be used to perform extra logging, metrics and other such things.
n - DebugNotification containing the data and context about what is happening.DebugNotificationListener.complete(Object) or
DebugNotificationListener.error(Object, Throwable) after the actual operation has ended.public void complete(C context)
DebugNotificationListener.start(DebugNotification) this is
invokedcontext - public void error(C context, java.lang.Throwable e)
DebugNotificationListener.start(DebugNotification)
this is invokedcontext - e -