Package rx
Interface Observer<T>
-
- Type Parameters:
T
- the type of item the Observer expects to observe
- All Known Subinterfaces:
AsyncEmitter<T>
- All Known Implementing Classes:
ActionNotificationObserver
,ActionSubscriber
,AsyncOnSubscribe.AsyncOuterManager
,AsyncOnSubscribe.UnicastSubject
,AsyncSubject
,BehaviorSubject
,BlockingOperatorLatest.LatestObserverIterator
,BlockingOperatorMostRecent.MostRecentObserver
,BlockingOperatorNext.NextObserver
,BlockingOperatorToIterator.SubscriberIterator
,BufferUntilSubscriber
,CachedObservable.CacheState
,CompletableOnSubscribeConcat.CompletableConcatSubscriber
,CompletableOnSubscribeMerge.CompletableMergeSubscriber
,DeferredScalarSubscriber
,ObserverSubscriber
,OnSubscribeAmb.AmbSubscriber
,OnSubscribeCollect.CollectSubscriber
,OnSubscribeCombineLatest.CombinerSubscriber
,OnSubscribeConcatMap.ConcatMapInnerSubscriber
,OnSubscribeConcatMap.ConcatMapSubscriber
,OnSubscribeDetach.DetachSubscriber
,OnSubscribeFilter.FilterSubscriber
,OnSubscribeFlattenIterable.FlattenIterableSubscriber
,OnSubscribeFromAsync.BaseAsyncEmitter
,OnSubscribeFromAsync.BufferAsyncEmitter
,OnSubscribeFromAsync.DropAsyncEmitter
,OnSubscribeFromAsync.ErrorAsyncEmitter
,OnSubscribeFromAsync.LatestAsyncEmitter
,OnSubscribeFromAsync.NoneAsyncEmitter
,OnSubscribeFromAsync.NoOverflowBaseAsyncEmitter
,OnSubscribeGroupJoin.ResultManager.LeftDurationObserver
,OnSubscribeGroupJoin.ResultManager.LeftObserver
,OnSubscribeGroupJoin.ResultManager.RightDurationObserver
,OnSubscribeGroupJoin.ResultManager.RightObserver
,OnSubscribeGroupJoin.WindowObservableFunc.WindowSubscriber
,OnSubscribeJoin.ResultSink.LeftSubscriber
,OnSubscribeJoin.ResultSink.LeftSubscriber.LeftDurationSubscriber
,OnSubscribeJoin.ResultSink.RightSubscriber
,OnSubscribeJoin.ResultSink.RightSubscriber.RightDurationSubscriber
,OnSubscribeMap.MapSubscriber
,OnSubscribeOnAssembly.OnAssemblySubscriber
,OnSubscribePublishMulticast
,OnSubscribePublishMulticast.ParentSubscriber
,OnSubscribeReduce.ReduceSubscriber
,OnSubscribeReduceSeed.ReduceSeedSubscriber
,OnSubscribeTakeLastOne.TakeLastOneSubscriber
,OperatorBufferWithSingleObservable.BufferingSubscriber
,OperatorBufferWithSize.BufferExact
,OperatorBufferWithSize.BufferOverlap
,OperatorBufferWithSize.BufferSkip
,OperatorBufferWithStartEndObservable.BufferingSubscriber
,OperatorBufferWithTime.ExactSubscriber
,OperatorBufferWithTime.InexactSubscriber
,OperatorCast.CastSubscriber
,OperatorDoOnRequest.ParentSubscriber
,OperatorEagerConcatMap.EagerInnerSubscriber
,OperatorEagerConcatMap.EagerOuterSubscriber
,OperatorGroupBy.GroupBySubscriber
,OperatorMapNotification.MapNotificationSubscriber
,OperatorMapPair.MapPairSubscriber
,OperatorMaterialize.ParentSubscriber
,OperatorMerge.InnerSubscriber
,OperatorMerge.MergeSubscriber
,OperatorObserveOn.ObserveOnSubscriber
,OperatorOnBackpressureBuffer.BufferSubscriber
,OperatorOnBackpressureLatest.LatestEmitter
,OperatorOnBackpressureLatest.LatestSubscriber
,OperatorPublish.PublishSubscriber
,OperatorReplay.ReplaySubscriber
,OperatorRetryWithPredicate.SourceSubscriber
,OperatorSampleWithTime.SamplerSubscriber
,OperatorScan.InitialProducer
,OperatorSingle.ParentSubscriber
,OperatorSwitch.InnerSubscriber
,OperatorSwitch.SwitchSubscriber
,OperatorSwitchIfEmpty.AlternateSubscriber
,OperatorSwitchIfEmpty.ParentSubscriber
,OperatorTakeLast.TakeLastSubscriber
,OperatorTakeLastTimed.TakeLastTimedSubscriber
,OperatorTakeTimed.TakeSubscriber
,OperatorTakeUntilPredicate.ParentSubscriber
,OperatorTimeoutBase.TimeoutSubscriber
,OperatorWindowWithObservable.BoundarySubscriber
,OperatorWindowWithObservable.SourceSubscriber
,OperatorWindowWithObservableFactory.BoundarySubscriber
,OperatorWindowWithObservableFactory.SourceSubscriber
,OperatorWindowWithSize.WindowExact
,OperatorWindowWithSize.WindowOverlap
,OperatorWindowWithSize.WindowSkip
,OperatorWindowWithStartEndObservable.SourceSubscriber
,OperatorWindowWithTime.ExactSubscriber
,OperatorWindowWithTime.InexactSubscriber
,OperatorWithLatestFromMany.WithLatestMainSubscriber
,OperatorWithLatestFromMany.WithLatestOtherSubscriber
,OperatorZip.Zip.InnerSubscriber
,OperatorZip.ZipSubscriber
,ProducerObserverArbiter
,PublishSubject
,QueuedProducer
,ReplaySubject
,ReplaySubject.ReplayState
,SafeSubscriber
,SerializedObserver
,SerializedSubject
,SerializedSubscriber
,Subject
,SubjectSubscriptionManager.SubjectObserver
,Subscriber
,SyncOnSubscribe.SubscriptionProducer
,TestObserver
,TestSubject
,TestSubscriber
,UnicastSubject
,UnicastSubject.State
public interface Observer<T>
Provides a mechanism for receiving push-based notifications.After an Observer calls an
Observable
'ssubscribe
method, theObservable
calls the Observer'sonNext(T)
method to provide notifications. A well-behavedObservable
will call an Observer'sonCompleted()
method exactly once or the Observer'sonError(java.lang.Throwable)
method exactly once.- See Also:
- ReactiveX documentation: Observable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
onCompleted()
Notifies the Observer that theObservable
has finished sending push-based notifications.void
onError(java.lang.Throwable e)
Notifies the Observer that theObservable
has experienced an error condition.void
onNext(T t)
Provides the Observer with a new item to observe.
-
-
-
Method Detail
-
onCompleted
void onCompleted()
Notifies the Observer that theObservable
has finished sending push-based notifications.The
Observable
will not call this method if it callsonError(java.lang.Throwable)
.
-
onError
void onError(java.lang.Throwable e)
Notifies the Observer that theObservable
has experienced an error condition.If the
Observable
calls this method, it will not thereafter callonNext(T)
oronCompleted()
.- Parameters:
e
- the exception encountered by the Observable
-
onNext
void onNext(T t)
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 eitheronCompleted()
oronError(java.lang.Throwable)
.- Parameters:
t
- the item emitted by the Observable
-
-