GitHub

API reference for Pollers.

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
ParameterTypeDescription
subscriptionBackingSubscription[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] | None

Remove 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 None

prepend

prepend(poller) -> None
ParameterTypeDescription
pollerPoller[A]
def prepend(self, poller: Poller[A]) -> None:
    self._waiting.appendleft(poller)

append

append(poller) -> None
ParameterTypeDescription
pollerPoller[A]
def append(self, poller: Poller[A]) -> None:
    self._waiting.append(poller)