Top Description Fields Constructors Methods
io.reactivex.rxjava3.subjects

pack-priv final Class SerializedSubject<T>

extends Subject<T>
implements AppendOnlyLinkedArrayList.NonThrowingPredicate<Object>
Class Inheritance
All Implemented Interfaces
io.reactivex.rxjava3.internal.util.AppendOnlyLinkedArrayList.NonThrowingPredicate, io.reactivex.rxjava3.functions.Predicate
Type Parameters
<T>
the item value type
Imports
io.reactivex.rxjava3.annotations.Nullable, io.reactivex.rxjava3.core.Observer, io.reactivex.rxjava3.disposables.Disposable, io.reactivex.rxjava3.internal.util.*, .AppendOnlyLinkedArrayList.NonThrowingPredicate, io.reactivex.rxjava3.plugins.RxJavaPlugins

Serializes calls to the Observer methods.

All other Observable and Subject methods are thread-safe by design.

Field Summary

Modifier and TypeField and Description
pack-priv final Subject<T>
actual

The actual subscriber to serialize Subscriber calls to.

pack-priv volatile boolean
done

Indicates a terminal event has been received and all further events will be dropped.

pack-priv boolean
emitting

Indicates an emission is going on, guarded by this.

pack-priv AppendOnlyLinkedArrayList<Object>
queue

If not null, it holds the missed NotificationLite events.

Constructor Summary

AccessConstructor and Description
pack-priv
SerializedSubject(final Subject<T>
the subject wrapped
actual
)

Constructor that wraps an actual subject.

Method Summary

Modifier and TypeMethod and Description
pack-priv void
emitLoop()

Loops until all notifications in the queue has been processed.

public @Nullable Throwable
getThrowable()

Implements abstract io.reactivex.rxjava3.subjects.Subject.getThrowable.

Returns the error that caused the Subject to terminate or null if the Subject hasn't terminated yet.
public boolean
hasComplete()

Implements abstract io.reactivex.rxjava3.subjects.Subject.hasComplete.

Returns true if the subject has reached a terminal state through a complete event.
public boolean
hasObservers()

Implements abstract io.reactivex.rxjava3.subjects.Subject.hasObservers.

Returns true if the subject has any Observers.
public boolean
hasThrowable()

Implements abstract io.reactivex.rxjava3.subjects.Subject.hasThrowable.

Returns true if the subject has reached a terminal state through an error event.
public void
onComplete()

Implements io.reactivex.rxjava3.core.Observer.onComplete.

Notifies the Observer that the Observable has finished sending push-based notifications.
public void
public void
onNext(T
the item emitted by the Observable
t
)

Implements io.reactivex.rxjava3.core.Observer.onNext.

Provides the Observer with a new item to observe.
public void
protected void
subscribeActual(Observer<? super T> observer)

public boolean
test(Object
the value
o
)

Implements io.reactivex.rxjava3.internal.util.AppendOnlyLinkedArrayList.NonThrowingPredicate.test.

Test the given input value and return a boolean.
Inherited from io.reactivex.rxjava3.subjects.Subject:
toSerialized

Field Detail

actualback to summary
pack-priv final Subject<T> actual

The actual subscriber to serialize Subscriber calls to.

doneback to summary
pack-priv volatile boolean done

Indicates a terminal event has been received and all further events will be dropped.

emittingback to summary
pack-priv boolean emitting

Indicates an emission is going on, guarded by this.

queueback to summary
pack-priv AppendOnlyLinkedArrayList<Object> queue

If not null, it holds the missed NotificationLite events.

Constructor Detail

SerializedSubjectback to summary
pack-priv SerializedSubject(final Subject<T> actual)

Constructor that wraps an actual subject.

Parameters
actual:Subject<T>

the subject wrapped

Method Detail

emitLoopback to summary
pack-priv void emitLoop()

Loops until all notifications in the queue has been processed.

getThrowableback to summary
public @Nullable Throwable getThrowable()

Implements abstract io.reactivex.rxjava3.subjects.Subject.getThrowable.

Doc from io.reactivex.rxjava3.subjects.Subject.getThrowable.

Returns the error that caused the Subject to terminate or null if the Subject hasn't terminated yet.

The method is thread-safe.

Returns:@Nullable Throwable

the error that caused the Subject to terminate or null if the Subject hasn't terminated yet

Annotations
@Override
@Nullable
hasCompleteback to summary
public boolean hasComplete()

Implements abstract io.reactivex.rxjava3.subjects.Subject.hasComplete.

Doc from io.reactivex.rxjava3.subjects.Subject.hasComplete.

Returns true if the subject has reached a terminal state through a complete event.

The method is thread-safe.

Returns:boolean

true if the subject has reached a terminal state through a complete event

Annotations
@Override
hasObserversback to summary
public boolean hasObservers()

Implements abstract io.reactivex.rxjava3.subjects.Subject.hasObservers.

Doc from io.reactivex.rxjava3.subjects.Subject.hasObservers.

Returns true if the subject has any Observers.

The method is thread-safe.

Returns:boolean

true if the subject has any Observers

Annotations
@Override
hasThrowableback to summary
public boolean hasThrowable()

Implements abstract io.reactivex.rxjava3.subjects.Subject.hasThrowable.

Doc from io.reactivex.rxjava3.subjects.Subject.hasThrowable.

Returns true if the subject has reached a terminal state through an error event.

The method is thread-safe.

Returns:boolean

true if the subject has reached a terminal state through an error event

Annotations
@Override
onCompleteback to summary
public void onComplete()

Implements io.reactivex.rxjava3.core.Observer.onComplete.

Doc from io.reactivex.rxjava3.core.Observer.onComplete.

Notifies the Observer that the Observable has finished sending push-based notifications.

The Observable will not call this method if it calls onError.

Annotations
@Override
onErrorback to summary
public void onError(Throwable t)
Annotations
@Override
onNextback to summary
public void onNext(T t)

Implements io.reactivex.rxjava3.core.Observer.onNext.

Doc from io.reactivex.rxjava3.core.Observer.onNext.

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 either onComplete or onError.

Parameters
t:T

the item emitted by the Observable

Annotations
@Override
onSubscribeback to summary
public void onSubscribe(Disposable d)
Annotations
@Override
subscribeActualback to summary
protected void subscribeActual(Observer<? super T> observer)
Annotations
@Override
testback to summary
public boolean test(Object o)

Implements io.reactivex.rxjava3.internal.util.AppendOnlyLinkedArrayList.NonThrowingPredicate.test.

Doc from io.reactivex.rxjava3.functions.Predicate.test.

Test the given input value and return a boolean.

Parameters
o:Object

the value

Returns:boolean

the boolean result

Annotations
@Override