wait_for
wait_for
Wait for a specific event type on this call, optionally filtered by a predicate function. This is a one-shot listener — it resolves on the first matching event and then removes itself.
Parameters
event_type
The event type string to wait for.
predicate
Optional filter function. If provided, the wait only resolves when the
predicate returns True for a received event.
timeout
Maximum seconds to wait. Raises asyncio.TimeoutError if exceeded. None
waits indefinitely.
Returns
RelayEvent — The first event matching the type and optional predicate.