Moo => 0,
'Module::Runtime' => 0,
'JSON::PP' => 0,
- 'CPS::Future' => 0,
+ 'Future' => 0.10,
+ 'MRO::Compat' => 0, # required to fatpack Moo
'Class::C3' => 0, # required to fatpack Moo
'String::ShellQuote' => 0, # required for ssh argument manipulation
'Log::Contextual' => 0.005000
use Module::Runtime qw(use_module);
use Scalar::Util qw(weaken blessed refaddr openhandle);
use JSON::PP qw(encode_json);
-use Moo;
+use Future;
use Carp qw(croak);
+use Moo;
BEGIN { router()->exclude_forwarding }
);
has on_close => (
- is => 'rw', default => sub { $_[0]->_install_future_handlers(CPS::Future->new) },
+ is => 'rw', default => sub { $_[0]->_install_future_handlers(Future->new) },
trigger => sub {
log_trace { "Installing handlers into future via trigger" };
$_[0]->_install_future_handlers($_[1])
sub send {
my ($self, $type, @call) = @_;
- my $future = CPS::Future->new;
+ my $future = Future->new;
my $remote = $self->remote_objects_by_id->{$call[0]};
unshift @call, $type => $self->_local_object_to_id($future);
use Module::Runtime qw(use_module);
use Object::Remote;
use Object::Remote::Logging qw( :log :dlog );
+use Future;
use IO::Socket::UNIX;
use Moo;
my $new = $fh->accept or die "Couldn't accept: $!";
log_trace { "Setting file handle non-blocking" };
$new->blocking(0);
- my $f = CPS::Future->new;
+ my $f = Future->new;
log_trace { "Creating a new connection with the remote node" };
my $c = use_module('Object::Remote::Connection')->new(
receive_from_fh => $new,
$extra_libs
-mObject::Remote
-mObject::Remote::Connector::STDIO
- -mCPS::Future
+ -mFuture
-mMRO::Compat
-mClass::C3
-mClass::C3::next
BEGIN { router()->exclude_forwarding }
-use CPS::Future;
+use Future;
our @EXPORT = qw(future await_future await_all);
sub future (&;$) {
- my $f = $_[0]->(CPS::Future->new);
+ my $f = $_[0]->(Future->new);
return $f if ((caller(1+($_[1]||0))||'') eq 'start');
await_future($f);
}
sub await_all {
log_trace { my $l = @_; "await_all() invoked with '$l' futures to wait on" };
- await_future(CPS::Future->wait_all(@_));
+ await_future(Future->wait_all(@_));
map $_->get, @_;
}
my ($method) = our $AUTOLOAD =~ /^start::(.+)$/;
my $res;
unless (eval { $res = $invocant->$method(@_); 1 }) {
- my $f = CPS::Future->new;
+ my $f = Future->new;
$f->fail($@);
return $f;
}
- unless (Scalar::Util::blessed($res) and $res->isa('CPS::Future')) {
- my $f = CPS::Future->new;
+ unless (Scalar::Util::blessed($res) and $res->isa('Future')) {
+ my $f = Future->new;
$f->done($res);
return $f;
}
my @args = @_;
# Need two copies since if we're called on an already complete future
# $f will be freed immediately
- my $ret = my $f = CPS::Future->new;
+ my $ret = my $f = Future->new;
$invocant->on_fail(sub { $f->fail(@_); undef($f); });
$invocant->on_done(sub {
my ($obj) = @_;
use Object::Remote::Logging qw(:log :dlog);
use Object::Remote::WatchDog;
use Object::Remote;
-use CPS::Future;
sub run {
my ($class, %args) = @_;
package Object::Remote::ReadChannel;
-use CPS::Future;
use Scalar::Util qw(weaken openhandle);
use Object::Remote::Logging qw(:log :dlog router );
use Moo;