aiq.utils.reactive.base.observable_base#

Attributes#

Classes#

ObservableBase

Abstract base class for an Observable that can be subscribed to.

Module Contents#

_T_out_co#
_T#
OnNext#
OnError#
OnComplete#
class ObservableBase#

Bases: Generic[_T_out_co], abc.ABC

Abstract base class for an Observable that can be subscribed to. Produces items of type _T_out for its subscribers.

subscribe(
on_next: aiq.utils.reactive.base.observer_base.ObserverBase[_T_out_co],
) aiq.utils.reactive.subscription.Subscription#
subscribe(
on_next: OnNext[_T_out_co] | None = None,
on_error: OnError | None = None,
on_complete: OnComplete | None = None,
) aiq.utils.reactive.subscription.Subscription

Subscribes an Observer or callbacks to this Observable.

If an Observer is provided, it will be subscribed to this Observable. If callbacks are provided, they will be wrapped into an Observer and subscribed to this Observable.