Suggest forking Mojo plugin

69 views
Skip to first unread message

Matija Papec

unread,
May 21, 2016, 11:07:28 AM5/21/16
to Mojolicious

These two are from core members so I can't decide which to use.

https://metacpan.org/pod/Mojolicious::Plugin::ForkCall
https://metacpan.org/pod/Mojo::IOLoop::ReadWriteFork

I would use it for perl legacy/blocking code, and for calling external binaries as well.


Dan Book

unread,
May 21, 2016, 2:14:32 PM5/21/16
to mojol...@googlegroups.com
ForkCall runs a perl function, and you get the return value back. ReadWriteFork runs a perl function or external binary, and you can write to STDIN and get STDOUT/STDERR events. Thus they are useful for slightly different use cases, choose the one that is simplest for your needs.

--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious...@googlegroups.com.
To post to this group, send email to mojol...@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Matija Papec

unread,
May 23, 2016, 5:45:09 AM5/23/16
to Mojolicious

Tnx, RWF looks more versatile so I'll try it.

regards

Joel Berger

unread,
May 28, 2016, 4:36:52 PM5/28/16
to Mojolicious
Agreed, they are for slightly different purposes. ForkCall is usually used to "unblock" a simple task while RWF is for more full featured interaction. Neither is inherently better than the other. Use the one that best suits your needs. (And yes I know that Dan has already said basically this same thing, but as the author of ForkCall I just wanted to write to concur).

Cheers,

Joel

Matija Papec

unread,
May 28, 2016, 5:34:57 PM5/28/16
to Mojolicious

Tnx; this RWF interactivity is really nice as you can run long-living worker and send him json requests.

Reply all
Reply to author
Forward
0 new messages