+17May20=======================================================================
+1. Backport DXSubprocess to change serialisations.
+ Currently the internals of Mojo::IOLoop::Subprocess defaults to
+ using Storeable as its cross-process argument and data serialisaion
+ method. It can use others. This update reverts back to the
+ original ForkCall method of using JSON.
10May20=======================================================================
1. Added basic changes so that users *could* have multiple connections to the
same node if it is allowed. This is work in progress and is there to see
use Time::HiRes qw(gettimeofday tv_interval);
use Mojo::IOLoop;
-use Mojo::IOLoop::Subprocess;
+use DXSubprocess;
use Mojo::UserAgent;
use strict;
return @out;
}
- my $fc = Mojo::IOLoop::Subprocess->new;
+ my $fc = DXSubprocess->new;
# $fc->serializer(\&encode_json);
# $fc->deserializer(\&decode_json);
$fc->run(
use IO::File;
use DXLog;
use Time::HiRes qw(gettimeofday tv_interval);
-use Mojo::IOLoop::Subprocess;
+use DXSubprocess;
use strict;
my $t0 = [gettimeofday];
dbg("DXCron::spawn: $line") if isdbg("cron");
- my $fc = Mojo::IOLoop::Subprocess->new();
+ my $fc = DXSubprocess->new();
$fc->run(
sub {
my @res = `$line`;
my $t0 = [gettimeofday];
dbg("DXCron::spawn_cmd run: $line") if isdbg('cron');
- my $fc = Mojo::IOLoop::Subprocess->new();
+ my $fc = DXSubprocess->new();
$fc->run(
sub {
$main::me->{_nospawn} = 1;
use DXProtHandle;
use Time::HiRes qw(gettimeofday tv_interval);
-use Mojo::IOLoop::Subprocess;
+use DXSubprocess;
use strict;
no strict 'refs';
- my $fc = Mojo::IOLoop::Subprocess->new;
+ my $fc = DXSubprocess->new;
# just behave normally if something has set the "one-shot" _nospawn in the channel
if ($self->{_nospawn}) {
--- /dev/null
+#
+# 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;
+}