Subjects are rx.observer.Observer and rx.observable.Observable at the same time. Whenever you need an explicit object that you can pass on as rx.observable.Observable but need to manualy call the onNext, onError and onCompleted methods of the rx.observable.Observable then you need a Subject.
It is recommended to create an rx.observable.Observable by using rx.observable.Observable.create(), rx.observable.Observable.fromEvent(), rx.observable.Observable.fromFuture(), rx.observable.Observable.generate() and so on.
Calls the onNext method on all observers of this Subject.
Calls the onError method on all observers of this Subject.
Calls the onCompleted method on all observers of this Subject.
Return a new Subject connecting the observable and the observer.
Returns a new Subject that synchonizes the call to the observers onNext methods. If a scheduler is provided, the values are observed on that rx.scheduler.Scheduler.
An AsyncSubject does remember the value from its last onNext call. Subscribers get either this value or wait for the onCompleted call if it has not happend.
If onError gets called, the subject stops waiting for the onCompleted and instead propagates the error to all current and future observers.
If onCompleted gets called, the subject stops waiting for the onCompleted and calls onNext(lastValue) on all current and future observers.
A BehaviorSubject does remember the value from its most recent onNext call. Subscribers get the current value on subscription and any firther updates via onNext. If no onNext call happend, the observers receive the initial value instead.
If onError gets called, the subject stops propagating value updates and instead propagates the error to all current and future observers.
If onCompleted gets called, the subject stops propagating value updates and instead propagates onCompleted() to all current and future observers.
Returns True if any rx.observer.Observer has subscribed.