rx.observers.SerializedObserver Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rxjava-core Show documentation
Show all versions of rxjava-core Show documentation
rxjava-core developed by Netflix
package rx.observers;
import java.util.ArrayList;
import rx.Observer;
/**
* Enforce single-threaded, serialized, ordered execution of onNext, onCompleted, onError.
*
* When multiple threads are notifying they will be serialized by:
*
*
Allowing only one thread at a time to emit
* Adding notifications to a queue if another thread is already emitting
* Not holding any locks or blocking any threads while emitting
*
*
* @param
*/
public class SerializedObserver implements Observer {
private final Observer super T> actual;
private boolean emitting = false;
private boolean terminated = false;
private ArrayList
© 2015 - 2024 Weber Informatics LLC | Privacy Policy