Open sharifulin opened 13 years ago
1. POE::Wheel::Run supports storable trough POE::Filter filters. If you want to get perl structure, just print it out in sub with Data::Dumper, collect input using MojoX-Run, then
local $@; my $h = eval $str; if ($@) { die "Bad data: $@"; }
Reading binary data from spawned process should also work.
What do you mean? You want to redirect output to file and you want that mojox-run should set permissions on that file? I guess that this is also bad idea...
Please give me some use cases for your wishes; i'll check what i could do about it.
regards, Brane
So you want to run some sub in subprocess, return some complex data from it and you want that parent would get that data in natural form?
something like this:
my $pid = $mojoxrun->spawn_sub(
sub { return { a => rand(), b => rand() } },
exit_cb => sub {
my ($pid, $res, $exception) = @_;
# $res holds hash reference returned by sub
}
);
?
Yes, it's simple and powerful :)
OK, seems reasonable, i'm going to implement it.
spawn_sub implemented in version 0.15. It may take several hours to be available from CPAN.
Good, I'll try it, thanks.
I like this thread :) bfg, does MojoX::Run work with Mojolicious 1.98 ?
sharifulin, as you can see from this thread, it doesn't. I'll fix it in a day or two :)
In the mean time, you can install EV, use EV Mojo::IOLoop implementation and spawn processes using AnyEvent::Subprocess, AnyEvent::Run, or simple AnyEvent::Util::run_cmd to spawn external process/sub.
Thanks, Brane.
What's a pity, MojoX::Run is good stuff, I like it! :)
On Wed, Sep 21, 2011 at 4:30 PM, Brane F. Gračnar < reply@reply.github.com>wrote:
sharifulin, as you can see from this thread, it doesn't. I'll fix it in a day or two :)
In the mean time, you can install EV, use EV Mojo::IOLoop implementation and spawn processes using AnyEvent::Subprocess, AnyEvent::Run, or simple AnyEvent::Util::run_cmd to spawn external process/sub.
Reply to this email directly or view it on GitHub: https://github.com/bfg/mojox-run/issues/1#issuecomment-2155409
С уважением, Анатолий Шарифулин.
Do you use EV backend? It seems that Mojolicious 1.65 broke non-socket fh support in IOLoop...
I'm getting:
Write failed: Can't call method "_connecting" on an undefined value at /usr/lib/perl5/site_perl/5.12.3/Mojo/IOLoop/Client.pm line 129.
I'm asking this because i'm thinking about implementing MojoX::Run on top of EV, which has stable interface... What do you think about depending MojoX::Run to EV?
Good idea. I'll use EV backend in MojoX::Run :)
Hi!
MojoX::Run is good stuff for Mojo, thanks!