DESCRIPTION

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.

For better scalability (epoll, kqueue) and to provide IPv6 as well as TLS support, the optional modules EV (4.0+), IO::Socket::IP (0.16+) and IO::Socket::SSL (1.75+) will be used automatically if they are installed. Individual features can also be disabled with the MOJO_NO_IPV6 and MOJO_NO_TLS environment variables.

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.

max_accepts

my $max = $loop->max_accepts;
$loop = $loop->max_accepts(1000);

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.

max_connections

The maximum number of parallel connections this event loop is allowed to handle before stopping to accept new incoming connections, defaults to 1000. Setting the value to 0 will make this event loop stop accepting new connections and allow it to shut down gracefully without interrupting existing connections.