Skip Menu |

This queue is for tickets about the IO-Async CPAN distribution.

Report information
The Basics
Id: 123780
Status: new
Priority: 0/
Queue: IO-Async

People
Owner: Nobody in particular
Requestors: DBOOK [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Feature request: method to check if loop is running
It would be very helpful for using IO::Async::Loop as an event reactor for other event loops if it provided a way to determine whether it was currently in a reactor tick (i.e. currently running). For example Mojo::IOLoop provides this as is_running via the underlying reactors, so Mojo::Reactor::IOAsync currently cannot tell if the loop is running unless it started it itself. This is also useful when making code conditional on whether it's run in an event loop context or outside one, and thus needs to manage the loop itself.
Additionally this needs to work when calling ->loop_once to be consistent. Example: $loop->is_running; # false my $f = $loop->delay_future(after => 1)->on_done(sub { $loop->is_running; # true $loop->stop; }); This should work regardless of whether the loop is then run by calling $loop->run or $f->await or $loop->loop_once until $f->is_ready.