Async-Event-Interval
view release on metacpan or search on metacpan
lib/Async/Event/Interval.pm view on Meta::CPAN
while (1) {
if ($event->error_message =~ /Callback timed out/) {
print "Event callback timed out... exiting to troubleshoot\n";
exit;
}
}
=head2 Shared scalar
L<shared_scalar()|/shared_scalar> returns a tied scalar reference whose value
lives in shared memory and is visible to the parent and to event callbacks.
The sub-sections below show common usage patterns; see
L<shared_scalar()|/shared_scalar> for the API reference and constraints.
=head3 Storing simple types
A shared scalar can hold any JSON-representable value: scalars, arrayrefs,
hashrefs, or combinations thereof.
use Async::Event::Interval;
t/92-end_phased_cleanup.t view on Meta::CPAN
sleep 60;
exit;
}
for (1..50) {
last if -e $flag1 && -e $flag2;
select(undef, undef, undef, 0.1);
}
ok(-e $flag1 && -e $flag2, "Multi-event: both callbacks invoked");
kill 'INT', $pid;
waitpid $pid, 0;
select(undef, undef, undef, 0.3);
unlink $flag1 if -e $flag1;
unlink $flag2 if -e $flag2;
my $segs_after = IPC::Shareable::seg_count();
my $sems_after = IPC::Shareable::sem_count();
( run in 0.696 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )