19 use Object::Remote::Future;
27 $C = sub { $f->done(S2F->new); undef($f); undef($C); };
44 use Object::Remote::Future;
52 $C = sub { $f->done('S3'); undef($f); undef($C); };
60 S1S->start::get_s2->then::get_s3->on_ready(sub { ($res) = $_[0]->get });
62 is($res, 'S3', 'Synchronous code ok');
66 S1F->start::get_s2->then::get_s3->on_ready(sub { ($res) = $_[0]->get });
68 ok(!$S2F::C, 'Second future not yet constructed');
72 ok($S2F::C, 'Second future constructed after first future completed');
74 ok(!$res, 'Nothing happened yet');
78 is($res, 'S3', 'Asynchronous code ok');
80 is(S1S->get_s2->get_s3, 'S3', 'Sync without start');
82 open my $fh, '<', File::Spec->devnull;
84 Object::Remote->current_loop->watch_io(
86 on_read_ready => sub {
87 $S1F::C->() if defined $S1F::C;
88 $S2F::C->() if defined $S2F::C;
92 is(S1F->get_s2->get_s3, 'S3', 'Async without start');