Package | Description |
---|---|
rx |
Base reactive classes: Observable, Single and Completable; base reactive consumers;
other common base interfaces.
|
rx.observables |
Classes extending the Observable base reactive class, synchronous and
asynchronous event generators.
|
rx.observers |
Default wrappers and implementations for the base reactive consumer classes and interfaces;
utility classes for creating them from callbacks.
|
Modifier and Type | Method and Description |
---|---|
Subscription |
Observable.subscribe(Subscriber<? super T> subscriber)
Subscribes to an Observable and provides a Subscriber that implements functions to handle the items the
Observable emits and any error or completion notification it issues.
|
Subscription |
Single.subscribe(Subscriber<? super T> subscriber)
Subscribes to a Single and provides a Subscriber that implements functions to handle the item the Single
emits or any error notification it issues.
|
<T> void |
Completable.subscribe(Subscriber<T> s)
Subscribes a regular Subscriber to this Completable instance which
will receive only an onError or onComplete event
and handles exceptions thrown by its onXXX methods.
|
Subscription |
Observable.unsafeSubscribe(Subscriber<? super T> subscriber)
Subscribes to an Observable and invokes
Observable.OnSubscribe function without any contract protection,
error handling, unsubscribe, or execution hooks. |
Subscription |
Single.unsafeSubscribe(Subscriber<? super T> subscriber)
Subscribes to a Single and invokes the
Single.OnSubscribe function without any contract protection,
error handling, unsubscribe, or execution hooks. |
<T> void |
Completable.unsafeSubscribe(Subscriber<T> s)
Subscribes a regular Subscriber to this Completable instance which
will receive only an onError or onComplete event.
|
Constructor and Description |
---|
Subscriber(Subscriber<?> subscriber)
Construct a Subscriber by using another Subscriber for backpressure and
for holding the subscription list (when
this.add(sub) is
called this will in fact call subscriber.add(sub) ). |
Subscriber(Subscriber<?> subscriber,
boolean shareSubscriptions)
Construct a Subscriber by using another Subscriber for backpressure and
optionally for holding the subscription list (if
shareSubscriptions is true then when
this.add(sub) is called this will in fact call
subscriber.add(sub) ). |
Modifier and Type | Method and Description |
---|---|
void |
AsyncOnSubscribe.call(Subscriber<? super T> actualSubscriber) |
void |
SyncOnSubscribe.call(Subscriber<? super T> subscriber) |
void |
BlockingObservable.subscribe(Subscriber<? super T> subscriber)
Subscribes to the source and calls the Subscriber methods on the current thread.
|
Modifier and Type | Class and Description |
---|---|
class |
SafeSubscriber<T>
SafeSubscriber is a wrapper around Subscriber that ensures that the Subscriber
complies with the Observable contract. |
class |
SerializedSubscriber<T>
Enforces single-threaded, serialized, ordered execution of
SerializedSubscriber.onNext(T) , SerializedSubscriber.onCompleted() , and
SerializedSubscriber.onError(java.lang.Throwable) . |
class |
TestSubscriber<T>
A
TestSubscriber is a variety of Subscriber that you can use for unit testing, to perform
assertions, inspect received events, or wrap a mocked Subscriber . |
Modifier and Type | Method and Description |
---|---|
static <T> Subscriber<T> |
Subscribers.create(Action1<? super T> onNext)
Creates a
Subscriber that receives the emissions of any Observable it subscribes to via
onNext but ignores onCompleted notifications;
it will throw an OnErrorNotImplementedException if onError is invoked. |
static <T> Subscriber<T> |
Subscribers.create(Action1<? super T> onNext,
Action1<Throwable> onError)
Creates an
Subscriber that receives the emissions of any Observable it subscribes to via
onNext and handles any onError notification but
ignores an onCompleted notification. |
static <T> Subscriber<T> |
Subscribers.create(Action1<? super T> onNext,
Action1<Throwable> onError,
Action0 onComplete)
Creates an
Subscriber that receives the emissions of any Observable it subscribes to via
onNext and handles any onError or
onCompleted notifications. |
static <T> Subscriber<T> |
Subscribers.empty()
Returns an inert
Subscriber that does nothing in response to the emissions or notifications
from any Observable it subscribes to. |
static <T> Subscriber<T> |
Subscribers.from(Observer<? super T> o)
Converts an
Observer into a Subscriber . |
Subscriber<? super T> |
SafeSubscriber.getActual()
Returns the
Subscriber underlying this SafeSubscriber . |
static <T> Subscriber<T> |
Subscribers.wrap(Subscriber<? super T> subscriber)
Returns a new
Subscriber that passes all events to
subscriber , has backpressure controlled by
subscriber and uses the subscription list of
subscriber when add(rx.Subscription) is
called. |
Modifier and Type | Method and Description |
---|---|
static <T> TestSubscriber<T> |
TestSubscriber.create(Subscriber<T> delegate)
Factory method to construct a TestSubscriber which delegates events to the given Subscriber and
an issues an initial request of Long.MAX_VALUE.
|
static <T> Subscriber<T> |
Subscribers.wrap(Subscriber<? super T> subscriber)
Returns a new
Subscriber that passes all events to
subscriber , has backpressure controlled by
subscriber and uses the subscription list of
subscriber when add(rx.Subscription) is
called. |
Constructor and Description |
---|
SafeSubscriber(Subscriber<? super T> actual) |
SerializedSubscriber(Subscriber<? super T> s) |
SerializedSubscriber(Subscriber<? super T> s,
boolean shareSubscriptions)
Constructor for wrapping and serializing a subscriber optionally sharing the same underlying subscription
list.
|
TestSubscriber(Subscriber<T> delegate)
Constructs a TestSubscriber which requests Long.MAX_VALUE and delegates events to
the given Subscriber.
|
Copyright © 2019. All rights reserved.