search for: update_handle

Displaying 2 results from an estimated 2 matches for "update_handle".

2014 Mar 14
3
Sys::Virt integration into other event loops
Hi all, I’m trying to integrate Perl’s Sys::Virt into an already existing AnyEvent program. I’m accustomed to writing things like this: use EV; use AnyEvent; use AnyEvent::Handle; my $h = AnyEvent::Handle->new(fh => $fh, …); $h->on_read(sub { … }); EV::run; ## start the event loop I can add some code in the on_read() handler and every time the $fh has something to read, it will fire
2014 Mar 14
0
Re: Sys::Virt integration into other event loops
...good docs or example code here, but you can see how todo this by looking at the Perl test suite. eg the t/800-events.t file. This test suite does a pure perl event loop based on select(). You'd probably want to adapt that and call into AnyEvent, instead of select(). The add_handle/remove_handle/update_handle/add_timeout/update_timeout/ remove_timeout methods should all call into appropriate AnyEvent APIs. Then you just need to run AnyEvent as normal. If you get this all working please do send back your code for it - it would be nice to add a examples/anyevent.pl demo file for this to help other people...