T
- Type of items received by the Subscriber
.public class LoggingSingleSubscriber<T> extends java.lang.Object implements SingleSource.Subscriber<T>
SingleSource.Subscriber
that wraps another SingleSource.Subscriber
, logging all signals received by the SingleSource.Subscriber
,
or sent via the Cancellable
.Constructor and Description |
---|
LoggingSingleSubscriber(java.lang.String name,
SingleSource.Subscriber<T> delegate)
|
Modifier and Type | Method and Description |
---|---|
void |
onError(java.lang.Throwable t)
Failed terminal state.
|
void |
onSubscribe(Cancellable c)
Called when the associated
SingleSource is subscribed via SingleSource.subscribe(Subscriber) . |
void |
onSuccess(T result)
Success terminal state.
|
public LoggingSingleSubscriber(java.lang.String name, SingleSource.Subscriber<T> delegate)
name
- the logging name.delegate
- the SingleSource.Subscriber
to delegate calls to.public void onSubscribe(Cancellable c)
SingleSource.Subscriber
SingleSource
is subscribed via SingleSource.subscribe(Subscriber)
.onSubscribe
in interface SingleSource.Subscriber<T>
c
- A Cancellable
that can be used to cancel the asynchronous computation for
this subscriber.public void onSuccess(T result)
SingleSource.Subscriber
No further events will be sent.
onSuccess
in interface SingleSource.Subscriber<T>
result
- of the SingleSource
.public void onError(java.lang.Throwable t)
SingleSource.Subscriber
No further events will be sent.
onError
in interface SingleSource.Subscriber<T>
t
- the throwable signaled.