17 use Object::Remote::Future;
25 $C = sub { $f->done(S2F->new); undef($f); };
42 use Object::Remote::Future;
50 $C = sub { $f->done('S3'); undef($f); };
58 S1S->start::get_s2->then::get_s3->on_ready(sub { ($res) = $_[0]->get });
60 is($res, 'S3', 'Synchronous code ok');
64 S1F->start::get_s2->then::get_s3->on_ready(sub { ($res) = $_[0]->get });
66 ok(!$S2F::C, 'Second future not yet constructed');
70 ok($S2F::C, 'Second future constructed after first future completed');
72 ok(!$res, 'Nothing happened yet');
76 is($res, 'S3', 'Asynchronous code ok');