Skip to content

Instantly share code, notes, and snippets.

# This is a recurring timer I use, the
# the timer should fire till a certain condition
# is fulfilled
# Caveats - I get Mojo::Reactor::Poll: Timer failed: Missing or empty input
# from time to time
my ($i, $done, $id) = (0, 0, undef);
$id = Mojo::IOLoop->recurring(0.2 => sub {
return if ($done);
app->log->debug("waiting for $json - $i time");