Observable Utils
Functions¶
as_observable_task
¶
as_observable_task(callback: Callable[_P, ObservableTaskCallbackReturnType[_OutT]]) -> Callable[_P, ObservableTask[_OutT]]
as_observable_task(*, debug: bool) -> Callable[[Callable[_P, ObservableTaskCallbackReturnType[_OutT]]], Callable[_P, ObservableTask[_OutT]]]
as_observable_task(callback: Callable[_P, ObservableTaskCallbackReturnType[_OutT]] | None = None, /, *, debug: bool | None = None) -> Callable[_P, ObservableTask[_OutT]] | Callable[[Callable[_P, ObservableTaskCallbackReturnType[_OutT]]], Callable[_P, ObservableTask[_OutT]]]
Convert a given callback into an observable task.
Notes:
-
The decorated callback can be either a standard
sync
orasync
function, as well as async
orasync
generator to stream data through theObservableTask
. -
It is important to note that the decorated callback is executed not upon calling the output function, but rather when the
ObservableTask
produced by the output function is executed.
PARAMETER | DESCRIPTION |
---|---|
callback
|
The callback to be encapsulated and made observable.
TYPE:
|
debug
|
Specifies the debug mode for the logger. If
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Callable[_P, ObservableTask[_OutT]] | Callable[[Callable[_P, ObservableTaskCallbackReturnType[_OutT]]], Callable[_P, ObservableTask[_OutT]]]
|
A function that, upon invocation, generates an |