mode.signals

Signals - implementation of the Observer pattern.

class mode.signals.BaseSignal(*, name: str = None, owner: Type = None, loop: asyncio.events.AbstractEventLoop = None, default_sender: Any = None, receivers: MutableSet[Any] = None, filter_receivers: MutableMapping[Any, MutableSet[Any]] = None)

Base class for signal/observer pattern.

asdict() → Mapping[str, Any]
clone(**kwargs: Any) → mode.types.signals.BaseSignalT
with_default_sender(sender: Any = None) → mode.types.signals.BaseSignalT
unpack_sender_from_args(*args: Any) → Tuple[T, Tuple[Any, ...]]
connect(fun: Union[Callable[[T, Any, BaseSignalT, Any], None], Callable[[T, Any, BaseSignalT, Any], Awaitable[None]]] = None, **kwargs: Any) → Callable
disconnect(fun: Union[Callable[[T, Any, BaseSignalT, Any], None], Callable[[T, Any, BaseSignalT, Any], Awaitable[None]]], *, weak: bool = False, sender: Any = None) → None
iter_receivers(sender: T_contra) → Iterable[Union[Callable[[T, Any, mode.types.signals.BaseSignalT, Any], None], Callable[[T, Any, mode.types.signals.BaseSignalT, Any], Awaitable[None]]]]
property ident
property label
class mode.signals.Signal(*, name: str = None, owner: Type = None, loop: asyncio.events.AbstractEventLoop = None, default_sender: Any = None, receivers: MutableSet[Any] = None, filter_receivers: MutableMapping[Any, MutableSet[Any]] = None)

Asynchronous signal (using async def functions).

async send(*args: Any, **kwargs: Any) → None
clone(**kwargs: Any) → mode.types.signals.SignalT
with_default_sender(sender: Any = None) → mode.types.signals.SignalT
class mode.signals.SyncSignal(*, name: str = None, owner: Type = None, loop: asyncio.events.AbstractEventLoop = None, default_sender: Any = None, receivers: MutableSet[Any] = None, filter_receivers: MutableMapping[Any, MutableSet[Any]] = None)

Signal that is synchronous (using regular def functions).

send(*args: Any, **kwargs: Any) → None
clone(**kwargs: Any) → mode.types.signals.SyncSignalT
with_default_sender(sender: Any = None) → mode.types.signals.SyncSignalT