Class SerializedSubject<T>

    • Field Detail

      • actual

        final Subject<T> actual
        The actual subscriber to serialize Subscriber calls to.
      • emitting

        boolean emitting
        Indicates an emission is going on, guarded by this.
      • done

        volatile boolean done
        Indicates a terminal event has been received and all further events will be dropped.
    • Constructor Detail

      • SerializedSubject

        SerializedSubject​(Subject<T> actual)
        Constructor that wraps an actual subject.
        Parameters:
        actual - the subject wrapped
    • Method Detail

      • subscribeActual

        protected void subscribeActual​(Observer<? super T> observer)
        Description copied from class: Observable
        Operator implementations (both source and intermediate) should implement this method that performs the necessary business logic and handles the incoming Observers.

        There is no need to call any of the plugin hooks on the current Observable instance or the Observer; all hooks and basic safeguards have been applied by Observable.subscribe(Observer) before this method gets called.

        Specified by:
        subscribeActual in class Observable<T>
        Parameters:
        observer - the incoming Observer, never null
      • emitLoop

        void emitLoop()
        Loops until all notifications in the queue has been processed.
      • hasObservers

        public boolean hasObservers()
        Description copied from class: Subject
        Returns true if the subject has any Observers.

        The method is thread-safe.

        Specified by:
        hasObservers in class Subject<T>
        Returns:
        true if the subject has any Observers
      • hasThrowable

        public boolean hasThrowable()
        Description copied from class: Subject
        Returns true if the subject has reached a terminal state through an error event.

        The method is thread-safe.

        Specified by:
        hasThrowable in class Subject<T>
        Returns:
        true if the subject has reached a terminal state through an error event
        See Also:
        Subject.getThrowable(), Subject.hasComplete()
      • getThrowable

        @Nullable
        public @Nullable java.lang.Throwable getThrowable()
        Description copied from class: Subject
        Returns the error that caused the Subject to terminate or null if the Subject hasn't terminated yet.

        The method is thread-safe.

        Specified by:
        getThrowable in class Subject<T>
        Returns:
        the error that caused the Subject to terminate or null if the Subject hasn't terminated yet
      • hasComplete

        public boolean hasComplete()
        Description copied from class: Subject
        Returns true if the subject has reached a terminal state through a complete event.

        The method is thread-safe.

        Specified by:
        hasComplete in class Subject<T>
        Returns:
        true if the subject has reached a terminal state through a complete event
        See Also:
        Subject.hasThrowable()