NAME
IO::Async::Loop::AnyEvent - use IO::Async with AnyEvent
SYNOPSIS
use IO::Async::Loop::AnyEvent;
my $loop = IO::Async::Loop::AnyEvent->new();
$loop->add( ... );
$loop->add( IO::Async::Signal->new(
      name => 'HUP',
      on_receipt => sub { ... },
) );
$loop->run;
DESCRIPTION
This subclass of IO::Async::Loop uses AnyEvent to perform its work.
CONSTRUCTOR
new
$loop = IO::Async::Loop::AnyEvent->new
This function returns a new instance of a IO::Async::Loop::AnyEvent object.
BUGS
watch_idleandunwatch_idledon't work properly againstAnyEvent::Impl::IOAsync. At least, the unit tests fail, and some scheduled CODErefs never get executed, and sit in the internal queue of the inner-nestedIO::Async::LoopthatAnyEvent::Impl::IOAsyncitself constructed. An easy workaround here is simply to pick another AnyEvent model, by using thePERL_ANYEVENT_MODELenvironment variable.That all said, I am honestly surprised this is the only thing that breaks, when
IO::Asyncis nested uponAnyEventitself running atop anotherIO::Async.The implementation of the
loop_oncemethod requires the use of an undocumentedAnyEventmethod (one_eventbefore version 6,_pollthereafter). This happens to work at the time of writing, but as it is undocumented it may be subject to change.The
loop_forevermethod does not rely on this undocumented method, so should be safe from upstream changes. Furthremore, ifAnyEventrather thanIO::Asyncremains ultimately in control of the runtime, by waiting on condvars, this should not be problematic.
AUTHOR
Paul Evans <leonerd@leonerd.org.uk>