Improved code
Added timeout argument for Mojo::IOLoop::Delay::begin method