RxJava



rx.operators
Class OperatorSynchronize<T>

java.lang.Object
  extended by rx.operators.OperatorSynchronize<T>
Type Parameters:
T - The type of the observable sequence.
All Implemented Interfaces:
Func1<Subscriber<? super T>,Subscriber<? super T>>, Function, Observable.Operator<T,T>

public final class OperatorSynchronize<T>
extends java.lang.Object
implements Observable.Operator<T,T>

Wraps an Observable in another Observable that ensures that the resulting Observable is chronologically well-behaved.

A well-behaved Observable does not interleave its invocations of the onNext, onCompleted, and onError methods of its Observers; it invokes onCompleted or onError only once; and it never invokes onNext after invoking either onCompleted or onError. The synchronize operation enforces this, and the Observable it returns invokes onNext and onCompleted or onError synchronously.

NOTE: Observable.create(rx.Observable.OnSubscribe) already wraps Observables so this is generally redundant.


Constructor Summary
OperatorSynchronize()
           
OperatorSynchronize(java.lang.Object lock)
           
 
Method Summary
 Subscriber<? super T> call(Subscriber<? super T> s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OperatorSynchronize

public OperatorSynchronize(java.lang.Object lock)

OperatorSynchronize

public OperatorSynchronize()
Method Detail

call

public Subscriber<? super T> call(Subscriber<? super T> s)
Specified by:
call in interface Func1<Subscriber<? super T>,Subscriber<? super T>>