Detect active Loop
joelwurtz opened this issue · 4 comments
joelwurtz commented
See async-interop/promise#17 which introduces the notion of active loop :
If there is no active loop, and one of the callbacks....
How do we check if there is or isn't an active loop ? I'm wondering if this should be specificied in this standard or we should do the following:
function hasLoop()
{
try {
Loop::get();
return true;
} catch (\LogicException $exception) {
return false;
}
}
kelunik commented
We don't. This will be removed soon.
bwoebi commented
Depending on knowledge whether the loop is active is a bad idea, this was a bad decision in my PR and it rightfully got not merged in the promise repo.
kelunik commented
@joelwurtz Can I close this issue? You won't have to know whether a loop is active.
joelwurtz commented
Fine for me yes, thanks !