Skip to content

Not understanding how to use Mojo::IOLoop::Subprocess #1744

Answered by Grinnz
john- asked this question in Q&A
Discussion options

You must be logged in to vote

I assume Mojo::IOLoop->Subprocess is a typo. Regardless you should create it using Mojo::IOLoop->subprocess(sub {}, sub {}), or better yet Mojo::IOLoop->subprocess->run_p: https://metacpan.org/pod/Mojo::IOLoop#subprocess

Context is also important. This seems like it's in Mojolicious application context so the IOLoop should already be running. If it was not, you would have to run it in order for the subprocess to be executed.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@john-
Comment options

Answer selected by marcusramberg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants