aiq.utils.reactive.base.observer_base#

Attributes#

Classes#

ObserverBase

Abstract base class for an Observer that can receive events of type _T_in.

Module Contents#

_T_in_contra#
class ObserverBase#

Bases: Generic[_T_in_contra], abc.ABC

Abstract base class for an Observer that can receive events of type _T_in.

Once on_error or on_complete is called, the observer is considered stopped.

abstractmethod on_next(value: _T_in_contra) None#

Called when a new item is produced. If the observer is stopped, this call should be ignored or raise an error.

abstractmethod on_error(exc: Exception) None#

Called when the producer signals an unrecoverable error. After this call, the observer is stopped.

abstractmethod on_complete() None#

Called when the producer signals completion (no more items). After this call, the observer is stopped.