Coro::EV - do events the coro-way, with EV
use Coro; use Coro::EV; EV::loop;
This module does two things: First, it offers some utility functions that might be useful for coroutines, and secondly, it integrates Coro into the EV main loop:
Before the process blocks (in EV::loop) to wait for events, this module will schedule and run all ready (= runnable) coroutines of the same or higher priority. After that, it will cede once to a coroutine of lower priority, then continue in the event loop.
That means that coroutines with the same or higher pripority as the coroutine running the main loop will inhibit event processing, while coroutines of lower priority will get the CPU, but cannot completeley inhibit event processing.
In general, you should always run EV::loop, either in your main program, or in a separate coroutine. If you don't do that and all coroutines start waiting for some events, this module will run the event loop once, but this is very inefficient.
Blocks the coroutine for at least $after
seconds.
Marc Lehmann <schmorp@schmorp.de> http://home.schmorp.de/