snakia.core.rx.async_bindable

Functions

overload(func)

Decorator for overloaded functions/methods.

Classes

AsyncBindable([default_value])

An asynchronous bindable.

BaseBindable([default_value])

BindableSubscriber(*args, **kwargs)

Generic()

Abstract base class for generic types.

TypeVar(name, *constraints[, bound, ...])

Type variable.

ValueChanged(old_value, new_value)

class snakia.core.rx.async_bindable.AsyncBindable(default_value=None)[source]

Bases: BaseBindable[T], Generic[T]

An asynchronous bindable.

__init__(default_value=None)[source]
property default_value: T
property has_default_value: bool
property has_value: bool
on(run_now=False)[source]

Decorator to subscribe to an value.

Return type:

Callable[[BindableSubscriber[TypeVar(T), Awaitable[Any]]], Optional[Awaitable[None]]]

async set(value)[source]

Set the value.

Return type:

None

set_silent(value)
Return type:

None

subscribe(subscriber, /, run_now=False)[source]

Subscribe to an value.

Return type:

Optional[Awaitable[None]]

property subscribers: tuple[BindableSubscriber[T, Awaitable[Any]], ...]

Get the subscribers.

unsubscribe(subscriber)[source]

Unsubscribe from an value.

Return type:

None

property value: T