class Pollers[A]
The takes parked on one subscription, oldest first (Effect's
MutableList<Deferred<A>>), and the messages given to woken ones
that have not collected them yet.
Functions#
__init__#
__init__(subscription) -> None| Parameter | Type | Description |
|---|---|---|
subscription | BackingSubscription[A] |
def __init__(self, subscription: BackingSubscription[A]) -> None:
self._subscription = subscription
self._waiting: deque[Poller[A]] = deque()
self._reserved: deque[A] = deque()take#
take() -> Poller[A] | NoneRemove and return the oldest parked take, if any.
Returns Poller[A] | None
def take(self) -> Poller[A] | None:
"""Remove and return the oldest parked take, if any."""
return self._waiting.popleft() if self._waiting else Noneprepend#
prepend(poller) -> None| Parameter | Type | Description |
|---|---|---|
poller | Poller[A] |
def prepend(self, poller: Poller[A]) -> None:
self._waiting.appendleft(poller)append#
append(poller) -> None| Parameter | Type | Description |
|---|---|---|
poller | Poller[A] |
def append(self, poller: Poller[A]) -> None:
self._waiting.append(poller)