in reply to Mojo::IOLoop and asynchronous work

Yes. Making an outbound HTTP request requires a little bit of CPU to set up and send the request and the rest of the time is just waiting for the server to respond, in other words waiting for IO, and that's what event loops do best. The cookbook has examples that might help. Now if you want to do lengthy CPU operations without blocking the process and the event loop, you can use subprocesses.

Replies are listed 'Best First'.
Re^2: Mojo::IOLoop and asynchronous work
by Anonymous Monk on Sep 29, 2018 at 22:23 UTC
    There it says "You can also use subprocesses, created with "subprocess" in Mojo::IOLoop, to perform computationally expensive operations without blocking the event loop." and "Operation that would block the event loop for 5 seconds"
    what kind of operation would block the event loop? And staying non blocking isn't what the event the loop is for anyway?