X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXSubprocess.pm;fp=perl%2FDXSubprocess.pm;h=44427621714da6251c72beb2ac3eb963c24efbc0;hb=9d190c7619d08c4d2e82b8ec3a9e5c84dac9b26a;hp=0000000000000000000000000000000000000000;hpb=3b932bf2afb86d5373c68ada44bb8f5eb642514f;p=spider.git diff --git a/perl/DXSubprocess.pm b/perl/DXSubprocess.pm new file mode 100644 index 00000000..44427621 --- /dev/null +++ b/perl/DXSubprocess.pm @@ -0,0 +1,23 @@ +# +# A light shim over Mojo::IOLoop::Subprocess (or Mojo::IOLoop::ForkCall, if we need to go back to that) +# +# But we stop using Storable! +# + +package DXSubprocess; + +use DXUtil; +use DXDebug; +use Mojo::IOLoop; +use Mojo::IOLoop::Subprocess; +use JSON; + +our @ISA = qw(Mojo::IOLoop::Subprocess); + +sub new +{ + my $pkg = shift; + my $class = ref $pkg || __PACKAGE__; + my $ref = Mojo::IOLoop::Subprocess->new->serialize(\&encode_json)->deserialize(\&decode_json); + return bless $ref, $class; +}