Subject: | Non blocking alternative to POE::Kernel->run_one_timeslice ? |
Date: | Tue, 12 Apr 2011 19:43:52 +0930 |
To: | bug-POE [...] rt.cpan.org |
From: | Justin Hawkins <justin [...] hawkins.id.au> |
Hi,
It would be nice to be able to combine Mojolicious (or other systems) with POE. Mojolicious has a trivial interface to keeping an alternative event queue alive, the example is here:
https://github.com/kraih/mojo/wiki/Mojolicious-and-POE/b1004e700082e713d41fe46315068581f48651b7
Unfortunately this does not quite work as expected, as run_one_timeslice blocks until the next piece of work on the queue is processed. So if the queue has only one event in 15s from now, the call will block (and the web server will stop) until that piece of work has been done.
I have found this blocking behaviour on POE-1.299.
Would it be possible to enhance this function to allow for non-blocking behaviour? Or add a new function that returns immediately if no work is due to be done?
Alternatively, if there is an easy way to find out before calling run_one_timeslice if there is work due, that would also be useful.
Regards,
Justin
--
Justin Hawkins
justin@hawkins.id.au