Top Description Inners Fields Constructors Methods
rx.internal.operators

public final Class OperatorObserveOn<T>

extends Object
implements Observable.Operator<T, T>
Class Inheritance
All Implemented Interfaces
rx.Observable.Operator, rx.functions.Func1, rx.functions.Function
Type Parameters
<T>
the transmitted value type
Imports
java.util.Queue, java.util.concurrent.atomic.AtomicLong, rx.*, .Observable.Operator, rx.exceptions.MissingBackpressureException, rx.functions.Action0, rx.internal.schedulers.*, rx.internal.util.RxRingBuffer, rx.internal.util.atomic.SpscAtomicArrayQueue, rx.internal.util.unsafe.*, rx.plugins.RxJavaHooks, rx.schedulers.Schedulers

Delivers events on the specified Scheduler asynchronously via an unbounded buffer.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
OperatorObserveOn.ObserveOnSubscriber<T>

Observe through individual queue per observer.

Field Summary

Modifier and TypeField and Description
private final int
private final boolean
private final Scheduler

Constructor Summary

AccessConstructor and Description
public
OperatorObserveOn(Scheduler
the scheduler to use
scheduler
,
boolean
delay errors until all normal events are emitted in the other thread?
delayError
)

public
OperatorObserveOn(Scheduler
the scheduler to use
scheduler
,
boolean
delay errors until all normal events are emitted in the other thread?
delayError
,
int
for the buffer feeding the Scheduler workers, defaults to RxRingBuffer.MAX if <= 0
bufferSize
)

Method Summary

Modifier and TypeMethod and Description
public Subscriber<? super T>
call(Subscriber<? super T> child)

Implements rx.functions.Func1.call.

public static <T> Observable.Operator<T, T>
rebatch(final int n)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bufferSizeback to summary
private final int bufferSize
delayErrorback to summary
private final boolean delayError
schedulerback to summary
private final Scheduler scheduler

Constructor Detail

OperatorObserveOnback to summary
public OperatorObserveOn(Scheduler scheduler, boolean delayError)
Parameters
scheduler:Scheduler

the scheduler to use

delayError:boolean

delay errors until all normal events are emitted in the other thread?

OperatorObserveOnback to summary
public OperatorObserveOn(Scheduler scheduler, boolean delayError, int bufferSize)
Parameters
scheduler:Scheduler

the scheduler to use

delayError:boolean

delay errors until all normal events are emitted in the other thread?

bufferSize:int

for the buffer feeding the Scheduler workers, defaults to RxRingBuffer.MAX if <= 0

Method Detail

callback to summary
public Subscriber<? super T> call(Subscriber<? super T> child)

Implements rx.functions.Func1.call.

Annotations
@Override
rebatchback to summary
public static <T> Observable.Operator<T, T> rebatch(final int n)
rx.internal.operators back to summary

pack-priv final Class OperatorObserveOn.ObserveOnSubscriber<T>

extends Subscriber<T>
implements Action0
Class Inheritance
All Implemented Interfaces
rx.functions.Action0, rx.functions.Action, rx.functions.Function

Observe through individual queue per observer.

Field Summary

Modifier and TypeField and Description
pack-priv final Subscriber<? super T>
pack-priv final AtomicLong
pack-priv final boolean
pack-priv long
emitted

Remembers how many elements have been emitted before the requests run out.

pack-priv Throwable
error

The single exception if not null, should be written before setting finished (release) and read after reading finished (acquire).

pack-priv volatile boolean
pack-priv final int
limit

The emission threshold that should trigger a replenishing request.

pack-priv final Queue<Object>
pack-priv final Scheduler.Worker
pack-priv final AtomicLong

Constructor Summary

AccessConstructor and Description
public
ObserveOnSubscriber(Scheduler scheduler, Subscriber<? super T> child, boolean delayError, int bufferSize)

Method Summary

Modifier and TypeMethod and Description
public void
pack-priv boolean
checkTerminated(boolean done, boolean isEmpty, Subscriber<? super T> a, Queue<Object> q)

pack-priv void
init()

public void
onCompleted()

Implements rx.Observer.onCompleted.

Notifies the Observer that the Observable has finished sending push-based notifications.
public void
onError(final Throwable
the exception encountered by the Observable
e
)

Implements rx.Observer.onError.

Notifies the Observer that the Observable has experienced an error condition.
public void
onNext(final T
the item emitted by the Observable
t
)

Implements rx.Observer.onNext.

Provides the Observer with a new item to observe.
protected void
Inherited from rx.Subscriber:
addisUnsubscribedonStartrequestsetProducerunsubscribe

Field Detail

childback to summary
pack-priv final Subscriber<? super T> child
counterback to summary
pack-priv final AtomicLong counter
delayErrorback to summary
pack-priv final boolean delayError
emittedback to summary
pack-priv long emitted

Remembers how many elements have been emitted before the requests run out.

errorback to summary
pack-priv Throwable error

The single exception if not null, should be written before setting finished (release) and read after reading finished (acquire).

finishedback to summary
pack-priv volatile boolean finished
limitback to summary
pack-priv final int limit

The emission threshold that should trigger a replenishing request.

queueback to summary
pack-priv final Queue<Object> queue
recursiveSchedulerback to summary
pack-priv final Scheduler.Worker recursiveScheduler
requestedback to summary
pack-priv final AtomicLong requested

Hides rx.Subscriber.requested.

Constructor Detail

ObserveOnSubscriberback to summary
public ObserveOnSubscriber(Scheduler scheduler, Subscriber<? super T> child, boolean delayError, int bufferSize)

Method Detail

callback to summary
public void call()

Implements rx.functions.Action0.call.

Annotations
@Override
checkTerminatedback to summary
pack-priv boolean checkTerminated(boolean done, boolean isEmpty, Subscriber<? super T> a, Queue<Object> q)
initback to summary
pack-priv void init()
onCompletedback to summary
public void onCompleted()

Implements rx.Observer.onCompleted.

Doc from rx.Observer.onCompleted.

Notifies the Observer that the Observable has finished sending push-based notifications.

The Observable will not call this method if it calls onError.

Annotations
@Override
onErrorback to summary
public void onError(final Throwable e)

Implements rx.Observer.onError.

Doc from rx.Observer.onError.

Notifies the Observer that the Observable has experienced an error condition.

If the Observable calls this method, it will not thereafter call onNext or onCompleted.

Parameters
e:Throwable

the exception encountered by the Observable

Annotations
@Override
onNextback to summary
public void onNext(final T t)

Implements rx.Observer.onNext.

Doc from rx.Observer.onNext.

Provides the Observer with a new item to observe.

The Observable may call this method 0 or more times.

The Observable will not call this method again after it calls either onCompleted or onError.

Parameters
t:T

the item emitted by the Observable

Annotations
@Override
scheduleback to summary
protected void schedule()