Mojo::IOLoop is a very minimalistic event loop based on Mojo::Reactor, it has been reduced to the absolute minimal feature set required to build solid and scalable non-blocking TCP clients and servers.

Depending on operating system, the default per-process and system-wide file descriptor limits are often very low and need to be tuned for better scalability. The LIBEV_FLAGS environment variable should also be used to select the best possible EV backend, which usually defaults to the not very scalable select.

The event loop will be resilient to time jumps if a monotonic clock is available through Time::HiRes. A TLS certificate and key are also built right in, to make writing test servers as easy as possible. Also note that for convenience the PIPE signal will be set to IGNORE when Mojo::IOLoop is loaded.

For better scalability (epoll, kqueue) and to provide non-blocking name resolution, SOCKS5 as well as TLS support, the optional modules EV (4.0+), Net::DNS::Native (0.15+), IO::Socket::Socks (0.64+) and IO::Socket::SSL (1.94+) will be used automatically if possible. Individual features can also be disabled with the MOJO_NO_NDN, MOJO_NO_SOCKS and MOJO_NO_TLS environment variables.

The maximum number of connections this event loop is allowed to accept before shutting down gracefully without interrupting existing connections, defaults to 0. Setting the value to 0 will allow this event loop to accept new connections indefinitely. Note that up to half of this value can be subtracted randomly to improve load balancing between multiple server processes.

Build Mojo::IOLoop::Delay object to manage callbacks and control the flow of events for this event loop, which can help you avoid deep nested closures that often result from continuation-passing style. Callbacks will be passed along to "steps" in Mojo::IOLoop::Delay.