Class ObservableWindowBoundarySelector.WindowBoundaryMainObserver<T,B,V>
- java.lang.Object
-
- java.lang.Number
-
- java.util.concurrent.atomic.AtomicInteger
-
- io.reactivex.rxjava3.internal.operators.observable.ObservableWindowBoundarySelector.WindowBoundaryMainObserver<T,B,V>
-
- All Implemented Interfaces:
Observer<T>
,Disposable
,java.io.Serializable
,java.lang.Runnable
- Enclosing class:
- ObservableWindowBoundarySelector<T,B,V>
static final class ObservableWindowBoundarySelector.WindowBoundaryMainObserver<T,B,V> extends java.util.concurrent.atomic.AtomicInteger implements Observer<T>, Disposable, java.lang.Runnable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
ObservableWindowBoundarySelector.WindowBoundaryMainObserver.WindowEndObserverIntercept<T,V>
(package private) static class
ObservableWindowBoundarySelector.WindowBoundaryMainObserver.WindowStartItem<B>
(package private) static class
ObservableWindowBoundarySelector.WindowBoundaryMainObserver.WindowStartObserver<B>
-
Field Summary
Fields Modifier and Type Field Description (package private) int
bufferSize
(package private) Function<? super B,? extends ObservableSource<V>>
closingIndicator
(package private) Observer<? super Observable<T>>
downstream
(package private) java.util.concurrent.atomic.AtomicBoolean
downstreamDisposed
(package private) long
emitted
(package private) AtomicThrowable
error
(package private) ObservableSource<B>
open
(package private) boolean
openDone
(package private) SimplePlainQueue<java.lang.Object>
queue
(package private) java.util.concurrent.atomic.AtomicLong
requested
(package private) CompositeDisposable
resources
private static long
serialVersionUID
(package private) ObservableWindowBoundarySelector.WindowBoundaryMainObserver.WindowStartObserver<B>
startObserver
(package private) Disposable
upstream
(package private) boolean
upstreamCanceled
(package private) boolean
upstreamDone
(package private) java.util.concurrent.atomic.AtomicLong
windowCount
(package private) java.util.List<UnicastSubject<T>>
windows
-
Constructor Summary
Constructors Constructor Description WindowBoundaryMainObserver(Observer<? super Observable<T>> downstream, ObservableSource<B> open, Function<? super B,? extends ObservableSource<V>> closingIndicator, int bufferSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
close(ObservableWindowBoundarySelector.WindowBoundaryMainObserver.WindowEndObserverIntercept<T,V> what)
(package private) void
closeError(java.lang.Throwable t)
void
dispose()
Dispose the resource, the operation should be idempotent.(package private) void
drain()
boolean
isDisposed()
Returns true if this resource has been disposed.void
onComplete()
Notifies theObserver
that theObservable
has finished sending push-based notifications.void
onError(java.lang.Throwable t)
Notifies theObserver
that theObservable
has experienced an error condition.void
onNext(T t)
Provides theObserver
with a new item to observe.void
onSubscribe(Disposable d)
Provides theObserver
with the means of cancelling (disposing) the connection (channel) with theObservable
in both synchronous (from withinObserver.onNext(Object)
) and asynchronous manner.(package private) void
open(B startValue)
(package private) void
openComplete()
(package private) void
openError(java.lang.Throwable t)
void
run()
(package private) void
terminateDownstream(Observer<?> downstream)
-
Methods inherited from class java.util.concurrent.atomic.AtomicInteger
accumulateAndGet, addAndGet, compareAndExchange, compareAndExchangeAcquire, compareAndExchangeRelease, compareAndSet, decrementAndGet, doubleValue, floatValue, get, getAcquire, getAndAccumulate, getAndAdd, getAndDecrement, getAndIncrement, getAndSet, getAndUpdate, getOpaque, getPlain, incrementAndGet, intValue, lazySet, longValue, set, setOpaque, setPlain, setRelease, toString, updateAndGet, weakCompareAndSet, weakCompareAndSetAcquire, weakCompareAndSetPlain, weakCompareAndSetRelease, weakCompareAndSetVolatile
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
downstream
final Observer<? super Observable<T>> downstream
-
open
final ObservableSource<B> open
-
closingIndicator
final Function<? super B,? extends ObservableSource<V>> closingIndicator
-
bufferSize
final int bufferSize
-
resources
final CompositeDisposable resources
-
startObserver
final ObservableWindowBoundarySelector.WindowBoundaryMainObserver.WindowStartObserver<B> startObserver
-
windows
final java.util.List<UnicastSubject<T>> windows
-
queue
final SimplePlainQueue<java.lang.Object> queue
-
windowCount
final java.util.concurrent.atomic.AtomicLong windowCount
-
downstreamDisposed
final java.util.concurrent.atomic.AtomicBoolean downstreamDisposed
-
requested
final java.util.concurrent.atomic.AtomicLong requested
-
emitted
long emitted
-
upstreamCanceled
volatile boolean upstreamCanceled
-
upstreamDone
volatile boolean upstreamDone
-
openDone
volatile boolean openDone
-
error
final AtomicThrowable error
-
upstream
Disposable upstream
-
-
Constructor Detail
-
WindowBoundaryMainObserver
WindowBoundaryMainObserver(Observer<? super Observable<T>> downstream, ObservableSource<B> open, Function<? super B,? extends ObservableSource<V>> closingIndicator, int bufferSize)
-
-
Method Detail
-
onSubscribe
public void onSubscribe(Disposable d)
Description copied from interface:Observer
Provides theObserver
with the means of cancelling (disposing) the connection (channel) with theObservable
in both synchronous (from withinObserver.onNext(Object)
) and asynchronous manner.- Specified by:
onSubscribe
in interfaceObserver<T>
- Parameters:
d
- theDisposable
instance whoseDisposable.dispose()
can be called anytime to cancel the connection
-
onNext
public void onNext(T t)
Description copied from interface:Observer
Provides theObserver
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 eitherObserver.onComplete()
orObserver.onError(java.lang.Throwable)
.
-
onError
public void onError(java.lang.Throwable t)
Description copied from interface:Observer
Notifies theObserver
that theObservable
has experienced an error condition.If the
Observable
calls this method, it will not thereafter callObserver.onNext(T)
orObserver.onComplete()
.
-
onComplete
public void onComplete()
Description copied from interface:Observer
Notifies theObserver
that theObservable
has finished sending push-based notifications.The
Observable
will not call this method if it callsObserver.onError(java.lang.Throwable)
.- Specified by:
onComplete
in interfaceObserver<T>
-
dispose
public void dispose()
Description copied from interface:Disposable
Dispose the resource, the operation should be idempotent.- Specified by:
dispose
in interfaceDisposable
-
isDisposed
public boolean isDisposed()
Description copied from interface:Disposable
Returns true if this resource has been disposed.- Specified by:
isDisposed
in interfaceDisposable
- Returns:
- true if this resource has been disposed
-
run
public void run()
- Specified by:
run
in interfacejava.lang.Runnable
-
open
void open(B startValue)
-
openError
void openError(java.lang.Throwable t)
-
openComplete
void openComplete()
-
close
void close(ObservableWindowBoundarySelector.WindowBoundaryMainObserver.WindowEndObserverIntercept<T,V> what)
-
closeError
void closeError(java.lang.Throwable t)
-
drain
void drain()
-
terminateDownstream
void terminateDownstream(Observer<?> downstream)
-
-