An observer wrapper that ensures the underlying implementation does not receive concurrent onNext / onError / onComplete events - for those cases in which the producer is emitting data too fast or concurrently without fulfilling the back-pressure requirements.
Represents an Observer that buffers emitted items until the call to connect()
happens.
A safe observer ensures too things:
A safe observer ensures too things:
- errors triggered by downstream observers are caught and streamed to onError
,
while the upstream gets an Ack.Done
, to stop sending events
- once an onError
or onComplete
was emitted, the observer no longer accepts
onNext
events, ensuring that the Rx grammar is respected.
This implementation doesn't address multi-threading concerns in any way.
Represents an Observer that buffers emitted items until the call to
connect()
happens. Before connecting, one can also schedule items to be prepended to the stream by means ofscheduleFirst
or for the stream to end by means ofschedulerError
orscheduleCompleted
.Used in the BehaviorSubject implementation.