Package | Description |
---|---|
rx |
Base reactive classes: Observable, Single and Completable; base reactive consumers;
other common base interfaces.
|
rx.exceptions |
Exception handling utilities, safe subscriber exception classes,
lifecycle exception classes.
|
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.
|
rx.subjects |
Classes extending the Observable base reactive class and implementing
the Observer interface at the same time (aka hot Observables).
|
Modifier and Type | Interface and Description |
---|---|
interface |
AsyncEmitter<T>
Abstraction over a RxJava Subscriber that allows associating
a resource with it and exposes the current number of downstream
requested amount.
|
Modifier and Type | Class and Description |
---|---|
class |
Subscriber<T>
Provides a mechanism for receiving push-based notifications from Observables, and permits manual
unsubscribing from these Observables.
|
Modifier and Type | Method and Description |
---|---|
void |
Notification.accept(Observer<? super T> observer)
Forwards this notification on to a specified
Observer . |
Observable<T> |
Observable.doOnEach(Observer<? super T> observer)
Modifies the source Observable so that it notifies an Observer for each item and terminal event it emits.
|
Subscription |
Observable.subscribe(Observer<? super T> observer)
Subscribes to an Observable and provides an Observer that implements functions to handle the items the
Observable emits and any error or completion notification it issues.
|
Subscription |
Single.subscribe(Observer<? super T> observer)
Subscribes an Observer to this single and returns a Subscription that allows
unsubscription.
|
Modifier and Type | Method and Description |
---|---|
static void |
Exceptions.throwOrReport(Throwable t,
Observer<?> o)
Forwards a fatal exception or reports it to the given Observer.
|
static void |
Exceptions.throwOrReport(Throwable t,
Observer<?> o,
Object value)
Forwards a fatal exception or reports it along with the value
caused it to the given Observer.
|
Modifier and Type | Method and Description |
---|---|
protected abstract S |
AsyncOnSubscribe.next(S state,
long requested,
Observer<Observable<? extends T>> observer)
Called to produce data to the downstream subscribers.
|
protected abstract S |
SyncOnSubscribe.next(S state,
Observer<? super T> observer)
Called to produce data to the downstream subscribers.
|
void |
BlockingObservable.subscribe(Observer<? super T> observer)
Subscribes to the source and calls back the Observer methods on the current thread.
|
Modifier and Type | Method and Description |
---|---|
static <S,T> SyncOnSubscribe<S,T> |
SyncOnSubscribe.createSingleState(Func0<? extends S> generator,
Action2<? super S,? super Observer<? super T>> next)
Generates a synchronous
SyncOnSubscribe that calls the provided next function
to generate data to downstream subscribers. |
static <S,T> SyncOnSubscribe<S,T> |
SyncOnSubscribe.createSingleState(Func0<? extends S> generator,
Action2<? super S,? super Observer<? super T>> next,
Action1<? super S> onUnsubscribe)
Generates a synchronous
SyncOnSubscribe that calls the provided next function
to generate data to downstream subscribers. |
static <S,T> AsyncOnSubscribe<S,T> |
AsyncOnSubscribe.createSingleState(Func0<? extends S> generator,
Action3<? super S,Long,? super Observer<Observable<? extends T>>> next)
Generates a synchronous
AsyncOnSubscribe that calls the provided next
function to generate data to downstream subscribers. |
static <S,T> AsyncOnSubscribe<S,T> |
AsyncOnSubscribe.createSingleState(Func0<? extends S> generator,
Action3<? super S,Long,? super Observer<Observable<? extends T>>> next,
Action1<? super S> onUnsubscribe)
Generates a synchronous
AsyncOnSubscribe that calls the provided next
function to generate data to downstream subscribers. |
static <S,T> SyncOnSubscribe<S,T> |
SyncOnSubscribe.createStateful(Func0<? extends S> generator,
Func2<? super S,? super Observer<? super T>,? extends S> next)
Generates a synchronous
SyncOnSubscribe that calls the provided next function
to generate data to downstream subscribers. |
static <S,T> SyncOnSubscribe<S,T> |
SyncOnSubscribe.createStateful(Func0<? extends S> generator,
Func2<? super S,? super Observer<? super T>,? extends S> next,
Action1<? super S> onUnsubscribe)
Generates a synchronous
SyncOnSubscribe that calls the provided next function
to generate data to downstream subscribers. |
static <S,T> AsyncOnSubscribe<S,T> |
AsyncOnSubscribe.createStateful(Func0<? extends S> generator,
Func3<? super S,Long,? super Observer<Observable<? extends T>>,? extends S> next)
Generates a synchronous
AsyncOnSubscribe that calls the provided next
function to generate data to downstream subscribers. |
static <S,T> AsyncOnSubscribe<S,T> |
AsyncOnSubscribe.createStateful(Func0<? extends S> generator,
Func3<? super S,Long,? super Observer<Observable<? extends T>>,? extends S> next,
Action1<? super S> onUnsubscribe)
Generates a synchronous
AsyncOnSubscribe that calls the provided next
function to generate data to downstream subscribers. |
static <T> SyncOnSubscribe<Void,T> |
SyncOnSubscribe.createStateless(Action1<? super Observer<? super T>> next)
Generates a synchronous
SyncOnSubscribe that calls the provided next function
to generate data to downstream subscribers. |
static <T> SyncOnSubscribe<Void,T> |
SyncOnSubscribe.createStateless(Action1<? super Observer<? super T>> next,
Action0 onUnsubscribe)
Generates a synchronous
SyncOnSubscribe that calls the provided next function
to generate data to downstream subscribers. |
static <T> AsyncOnSubscribe<Void,T> |
AsyncOnSubscribe.createStateless(Action2<Long,? super Observer<Observable<? extends T>>> next)
Generates a synchronous
AsyncOnSubscribe that calls the provided next
function to generate data to downstream subscribers. |
static <T> AsyncOnSubscribe<Void,T> |
AsyncOnSubscribe.createStateless(Action2<Long,? super Observer<Observable<? extends T>>> next,
Action0 onUnsubscribe)
Generates a synchronous
AsyncOnSubscribe that calls the provided next
function to generate data to downstream subscribers. |
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 |
SerializedObserver<T>
Enforces single-threaded, serialized, ordered execution of
SerializedObserver.onNext(T) , SerializedObserver.onCompleted() , and
SerializedObserver.onError(java.lang.Throwable) . |
class |
SerializedSubscriber<T>
Enforces single-threaded, serialized, ordered execution of
SerializedSubscriber.onNext(T) , SerializedSubscriber.onCompleted() , and
SerializedSubscriber.onError(java.lang.Throwable) . |
class |
TestObserver<T>
Deprecated.
use the
TestSubscriber insteand. |
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> Observer<T> |
Observers.create(Action1<? super T> onNext)
Creates an
Observer 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> Observer<T> |
Observers.create(Action1<? super T> onNext,
Action1<Throwable> onError)
Creates an
Observer that receives the emissions of any Observable it subscribes to via
onNext and handles any onError notification but ignores
an onCompleted notification. |
static <T> Observer<T> |
Observers.create(Action1<? super T> onNext,
Action1<Throwable> onError,
Action0 onComplete)
Creates an
Observer that receives the emissions of any Observable it subscribes to via
onNext and handles any onError or
onCompleted notifications. |
static <T> Observer<T> |
Observers.empty()
|
Modifier and Type | Method and Description |
---|---|
static <T> TestSubscriber<T> |
TestSubscriber.create(Observer<T> delegate)
Factory method to construct a TestSubscriber which delegates events to the given Observer and
an issues an initial request of Long.MAX_VALUE.
|
static <T> TestSubscriber<T> |
TestSubscriber.create(Observer<T> delegate,
long initialRequest)
Factory method to construct a TestSubscriber which delegates events to the given Observer and
issues the given initial request amount.
|
static <T> Subscriber<T> |
Subscribers.from(Observer<? super T> o)
Converts an
Observer into a Subscriber . |
Constructor and Description |
---|
SerializedObserver(Observer<? super T> s) |
TestObserver(Observer<T> delegate)
Deprecated.
|
TestSubscriber(Observer<T> delegate)
Constructs a TestSubscriber which requests Long.MAX_VALUE and delegates events to
the given Observer.
|
TestSubscriber(Observer<T> delegate,
long initialRequest)
Constructs a TestSubscriber with the initial request to be requested from upstream
and a delegate Observer to wrap.
|
Modifier and Type | Class and Description |
---|---|
class |
AsyncSubject<T>
Subject that publishes only the last item observed to each
Observer once the source Observable
has completed. |
class |
BehaviorSubject<T>
Subject that emits the most recent item it has observed and all subsequent observed items to each subscribed
Observer . |
class |
PublishSubject<T>
Subject that, once an
Observer has subscribed, emits all subsequently observed items to the
subscriber. |
class |
ReplaySubject<T>
Subject that buffers all items it observes and replays them to any
Observer that subscribes. |
class |
SerializedSubject<T,R>
Wraps a
Subject so that it is safe to call its various on methods from different threads. |
class |
Subject<T,R>
Represents an object that is both an Observable and an Observer.
|
class |
TestSubject<T>
A variety of Subject that is useful for testing purposes.
|
class |
UnicastSubject<T>
A Subject variant which buffers events until a single Subscriber arrives and replays them to it
and potentially switches to direct delivery once the Subscriber caught up and requested an unlimited
amount.
|
Copyright © 2020. All rights reserved.