use Object::Remote;
use File::Spec;
+$ENV{OBJECT_REMOTE_TEST_LOGGER} = 1;
+
{
package S1S;
our $C;
sub get_s2 {
+ shift->maybe::start::_real_get_s2;
+ }
+
+ sub _real_get_s2 {
future {
my $f = shift;
$C = sub { $f->done(S2F->new); undef($f); undef($C); };
is(S1S->get_s2->get_s3, 'S3', 'Sync without start');
-open my $fh, '<', File::Spec->devnull;
-
-Object::Remote->current_loop->watch_io(
- handle => $fh,
- on_read_ready => sub {
- $S1F::C->() if defined $S1F::C;
- $S2F::C->() if defined $S2F::C;
+Object::Remote->current_loop->watch_time(
+ after => 0.1,
+ code => sub {
+ $S1F::C->();
+ Object::Remote->current_loop->watch_time(
+ after => 0.1,
+ code => sub { $S2F::C->() }
+ );
}
);