Event
struct EventA readiness event for a single registered fd.
Fields:
token: The caller's per-fd token passed to register / modify.
WAKEUP_TOKEN (all 1s) is reserved for internal wakeup
events and should be filtered out by the reactor layer.
flags: Bitmask of EVENT_READABLE | WRITABLE | ERROR | HUP.
Implements Copyable, ImplicitlyCopyable, Movable
- Fields
token: UInt64flags: Int
__init__
def __init__(out self, token: UInt64, flags: Int) Construct an event with the given token and flags.
- Args
token: Per-fd token assigned at registration time.flags: Bitmask ofEVENT_*bits describing which conditions the reactor observed on the fd.
is_readable
def is_readable(self) -> Bool Return True if EVENT_READABLE is set.
is_writable
def is_writable(self) -> Bool Return True if EVENT_WRITABLE is set.
is_error
def is_error(self) -> Bool Return True if EVENT_ERROR is set.
is_hup
def is_hup(self) -> Bool Return True if EVENT_HUP is set (remote closed).
is_wakeup
def is_wakeup(self) -> Bool Return True if this event is the reactor's internal wakeup.
Callers usually ignore wakeup events — they exist only to break
poll out of its wait when another thread wants attention.