The EvLoop class
Represents an event loop that is always distinct from the default loop. Unlike the default loop, it cannot handle EvChild watchers.
Intro
Represents an event loop that is always distinct from the default loop. Unlike the default loop, it cannot handle EvChild watchers.
Having threads we have to create a loop per thread, and use the default loop in the parent thread.
The default event loop is initialized automatically by Ev. It is accessible via methods of the Ev class, or via EvLoop::defaultLoop method.
Class synopsis
Properties
dataCustom data attached to loop
backendReadonly. The backend flags indicating the event backend in use.
is_default_loopReadonly. true if it is the default event loop.
iterationThe current iteration count of the loop. See
Ev::iterationpendingThe number of pending watchers.
0indicates that there are no watchers pending.io_intervalHigher
io_intervalallows libev to spend more time collectingEvIoevents, so more events can be handled per iteration, at the cost of increasing latency. Timeouts (bothEvPeriodicandEvTimer) will not be affected. Setting this to a non-zero value will introduce an additionalsleep()call into most loop iterations. The sleep time ensures that libev will not poll forEvIoevents more often than once per this interval, on average. Many programs can usually benefit by setting theio_intervalto a value near0.1, which is often enough for interactive servers(not for games). It usually doesn't make much sense to set it to a lower value than0.01, as this approaches the timing granularity of most systems.See also FUNCTIONS CONTROLLING EVENT LOOPS.
timeout_intervalHigher
timeout_intervalallows libev to spend more time collecting timeouts, at the expense of increased latency/jitter/inexactness(the watcher callback will be called later).EvIowatchers will not be affected. Setting this to a non-null value will not introduce any overhead in libev. See also FUNCTIONS CONTROLLING EVENT LOOPS.depthThe recursion depth. See
Ev::depth.
Evloop