Package rx
Interface AsyncEmitter<T>
- Type Parameters:
T
- the value type to emit
- All Superinterfaces:
Observer<T>
- All Known Implementing Classes:
OnSubscribeFromAsync.BaseAsyncEmitter
,OnSubscribeFromAsync.BufferAsyncEmitter
,OnSubscribeFromAsync.DropAsyncEmitter
,OnSubscribeFromAsync.ErrorAsyncEmitter
,OnSubscribeFromAsync.LatestAsyncEmitter
,OnSubscribeFromAsync.NoneAsyncEmitter
,OnSubscribeFromAsync.NoOverflowBaseAsyncEmitter
Abstraction over a RxJava Subscriber that allows associating
a resource with it and exposes the current number of downstream
requested amount.
The onNext, onError and onCompleted methods should be called in a sequential manner, just like the Observer's methods. The other methods are threadsafe.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum
Options to handle backpressure in the emitter.static interface
A functional interface that has a single close method that can throw. -
Method Summary
Modifier and TypeMethodDescriptionlong
The current outstanding request amount.void
Sets a Cancellable on this emitter; any previous Subscription or Cancellation will be unsubscribed/cancelled.void
Sets a Subscription on this emitter; any previous Subscription or Cancellation will be unsubscribed/cancelled.Methods inherited from interface rx.Observer
onCompleted, onError, onNext
-
Method Details
-
setSubscription
Sets a Subscription on this emitter; any previous Subscription or Cancellation will be unsubscribed/cancelled.- Parameters:
s
- the subscription, null is allowed
-
setCancellation
Sets a Cancellable on this emitter; any previous Subscription or Cancellation will be unsubscribed/cancelled.- Parameters:
c
- the cancellable resource, null is allowed
-
requested
long requested()The current outstanding request amount.This method it threadsafe.
- Returns:
- the current outstanding request amount
-