19 use Object::Remote::Future;
25 shift->maybe::start::_real_get_s2;
31 $C = sub { $f->done(S2F->new); undef($f); undef($C); };
48 use Object::Remote::Future;
56 $C = sub { $f->done('S3'); undef($f); undef($C); };
64 S1S->start::get_s2->then::get_s3->on_ready(sub { ($res) = $_[0]->get });
66 is($res, 'S3', 'Synchronous code ok');
70 S1F->start::get_s2->then::get_s3->on_ready(sub { ($res) = $_[0]->get });
72 ok(!$S2F::C, 'Second future not yet constructed');
76 ok($S2F::C, 'Second future constructed after first future completed');
78 ok(!$res, 'Nothing happened yet');
82 is($res, 'S3', 'Asynchronous code ok');
84 is(S1S->get_s2->get_s3, 'S3', 'Sync without start');
86 Object::Remote->current_loop->watch_time(
90 Object::Remote->current_loop->watch_time(
92 code => sub { $S2F::C->() }
97 is(S1F->get_s2->get_s3, 'S3', 'Async without start');