Top Description Methods
rx

public Interface SingleEmitter<T>

Known Direct Implementers
rx.internal.operators.SingleFromEmitter.SingleEmitterImpl
Type Parameters
<T>
the success value type
Imports
rx.functions.Cancellable

Abstraction over a SingleSubscriber that gets either an onSuccess or onError signal and allows registering an cancellation/unsubscription callback.

All methods are thread-safe; calling onSuccess or onError twice or one after the other has no effect.

History: 1.2.3 - experimental

Since
1.3

Method Summary

Modifier and TypeMethod and Description
public void
onError(Throwable
the exception encountered by the Observable
t
)

Notifies the SingleSubscriber that the Single has experienced an error condition.

public void
onSuccess(T
the success value
t
)

Notifies the SingleSubscriber that the Single has completed successfully with the given value.

public void
setCancellation(Cancellable
the cancellable resource, null is allowed
c
)

Sets a Cancellable on this emitter; any previous Subscription or Cancellation will be unsubscribed/cancelled.

public void
setSubscription(Subscription
the subscription, null is allowed
s
)

Sets a Subscription on this emitter; any previous Subscription or Cancellation will be unsubscribed/cancelled.

Method Detail

onErrorback to summary
public void onError(Throwable t)

Notifies the SingleSubscriber that the Single has experienced an error condition.

If the Single calls this method, it will not thereafter call onSuccess.

Parameters
t:Throwable

the exception encountered by the Observable

onSuccessback to summary
public void onSuccess(T t)

Notifies the SingleSubscriber that the Single has completed successfully with the given value.

If the Single calls this method, it will not thereafter call onError.

Parameters
t:T

the success value

setCancellationback to summary
public void setCancellation(Cancellable c)

Sets a Cancellable on this emitter; any previous Subscription or Cancellation will be unsubscribed/cancelled.

Parameters
c:Cancellable

the cancellable resource, null is allowed

setSubscriptionback to summary
public void setSubscription(Subscription s)

Sets a Subscription on this emitter; any previous Subscription or Cancellation will be unsubscribed/cancelled.

Parameters
s:Subscription

the subscription, null is allowed