NAME
Fetch::Loop - the event-loop adapter interface Fetch drives
DESCRIPTION
Fetch's C core owns the sockets and the request state machine; a loop only has to tell it when a socket is readable or writable. An adapter is any object with a single method:
_ft_arm($fd, $mask, $cv)
Reconcile the readiness interest registered for the bare descriptor $fd so that exactly the directions in $mask are watched, each firing $cv (a Perl coderef, called with no arguments) when the descriptor is ready. $mask is a bitmask of FT_READ (0x1) and FT_WRITE (0x2); $mask == 0 removes all interest for $fd. $cv is the same coderef across calls for a given connection, so adapters may key their bookkeeping on $fd alone.
The C core calls this whenever a connection needs a different readiness direction, and once more with $mask == 0 when the connection closes.
Adapters also provide install_await, which sets $Fetch::Future::AWAIT so a bare $future->get pumps the underlying loop until the future is ready.
ADAPTERS
Fetch::Loop::Standalone (the vendored C loop, the default), Fetch::Loop::Hyperman, Fetch::Loop::IOAsync, Fetch::Loop::AnyEvent.
AUTHOR
LNATION <email@lnation.org>
LICENSE AND COPYRIGHT
This software is Copyright (c) 2026 by LNATION. This is free software, licensed under the Artistic License 2.0.