mode.types.signals — mode-ng 0.4.0 documentation

# `mode.types.signals`

Type classes for `mode.signals`.

class mode.types.signals.BaseSignalT(*, name: Optional[str] = None, owner: Optional[Type] = None, loop: Optional[AbstractEventLoop] = None, default_sender: Optional[Any] = None, receivers: Optional[MutableSet[Union[Callable[[], Union[Callable[[T, Any, BaseSignalT, Any], None], Callable[[T, Any, BaseSignalT, Any], Awaitable[None]]]], weakref[Union[Callable[[T, Any, mode.types.signals.BaseSignalT, Any], NoneType], Callable[[T, Any, mode.types.signals.BaseSignalT, Any], Awaitable[NoneType]]]]]]] = None, filter_receivers: Optional[MutableMapping[Any, MutableSet[Union[Callable[[], Union[Callable[[T, Any, BaseSignalT, Any], None], Callable[[T, Any, BaseSignalT, Any], Awaitable[None]]]], weakref[Union[Callable[[T, Any, mode.types.signals.BaseSignalT, Any], NoneType], Callable[[T, Any, mode.types.signals.BaseSignalT, Any], Awaitable[NoneType]]]]]]]] = None)

  Base type for all signals.

  abstract clone(**kwargs: Any) → BaseSignalT
  abstract connect(fun: Union[Callable[[T, Any, BaseSignalT, Any], None], Callable[[T, Any, BaseSignalT, Any], Awaitable[None]]], **kwargs: Any) → Callable
  abstract disconnect(fun: Union[Callable[[T, Any, BaseSignalT, Any], None], Callable[[T, Any, BaseSignalT, Any], Awaitable[None]]], *, sender: Optional[Any] = None, weak: bool = True) → None
  name: str
  owner: Optional[Type]
  abstract with_default_sender(sender: Optional[Any] = None) → BaseSignalT

class mode.types.signals.SignalT(*, name: Optional[str] = None, owner: Optional[Type] = None, loop: Optional[AbstractEventLoop] = None, default_sender: Optional[Any] = None, receivers: Optional[MutableSet[Union[Callable[[], Union[Callable[[T, Any, BaseSignalT, Any], None], Callable[[T, Any, BaseSignalT, Any], Awaitable[None]]]], weakref[Union[Callable[[T, Any, mode.types.signals.BaseSignalT, Any], NoneType], Callable[[T, Any, mode.types.signals.BaseSignalT, Any], Awaitable[NoneType]]]]]]] = None, filter_receivers: Optional[MutableMapping[Any, MutableSet[Union[Callable[[], Union[Callable[[T, Any, BaseSignalT, Any], None], Callable[[T, Any, BaseSignalT, Any], Awaitable[None]]]], weakref[Union[Callable[[T, Any, mode.types.signals.BaseSignalT, Any], NoneType], Callable[[T, Any, mode.types.signals.BaseSignalT, Any], Awaitable[NoneType]]]]]]]] = None)

  Base class for all async signals (using `async def`).

  abstract clone(**kwargs: Any) → SignalT
  abstract async send(sender: T_contra, *args: Any, **kwargs: Any) → None
  abstract with_default_sender(sender: Any = None) → SignalT

class mode.types.signals.SyncSignalT(*, name: Optional[str] = None, owner: Optional[Type] = None, loop: Optional[AbstractEventLoop] = None, default_sender: Optional[Any] = None, receivers: Optional[MutableSet[Union[Callable[[], Union[Callable[[T, Any, BaseSignalT, Any], None], Callable[[T, Any, BaseSignalT, Any], Awaitable[None]]]], weakref[Union[Callable[[T, Any, mode.types.signals.BaseSignalT, Any], NoneType], Callable[[T, Any, mode.types.signals.BaseSignalT, Any], Awaitable[NoneType]]]]]]] = None, filter_receivers: Optional[MutableMapping[Any, MutableSet[Union[Callable[[], Union[Callable[[T, Any, BaseSignalT, Any], None], Callable[[T, Any, BaseSignalT, Any], Awaitable[None]]]], weakref[Union[Callable[[T, Any, mode.types.signals.BaseSignalT, Any], NoneType], Callable[[T, Any, mode.types.signals.BaseSignalT, Any], Awaitable[NoneType]]]]]]]] = None)

  Base class for all synchronous signals (using regular `def`).

  abstract clone(**kwargs: Any) → SyncSignalT
  abstract send(sender: T_contra, *args: Any, **kwargs: Any) → None
  abstract with_default_sender(sender: Any = None) → SyncSignalT