AnyEvent-Digest
view release on metacpan or search on metacpan
lib/AnyEvent/Digest.pm view on Meta::CPAN
B<CAUTION:> Currerntly, other L<AnyEvent> watchers have B<NO> chance to run during this call.
=head2 C<addfile()>
This method uses blocking wait + C<addfile_async()>.
=head2 C<addfile_base()>
Forwarded to C<addfile()> in the base module. If you need to avoid blocking wait somewhere, this might be helpful.
However, during the call, other L<AnyEvent> watchers are blocked.
=head1 SEE ALSO
=over 4
=item *
L<AnyEvent>
=item *
t/02-async-idle.t view on Meta::CPAN
sub pipe_from_fork ($) {
my $parent = shift;
pipe $parent, my $child or die;
my $pid = fork();
die "fork() failed: $!" unless defined $pid;
if ($pid) {
close $child;
}
else {
close $parent;
close STDOUT; # Without this, Win32 may be blocked
open(STDOUT, ">&=" . fileno($child)) or die;
}
$pid;
}
my $fh = gensym;
my $pid = pipe_from_fork($fh);
die if ! defined ($pid);
if(!$pid) {
binmode STDOUT;
t/03-async-aio.t view on Meta::CPAN
sub pipe_from_fork ($) {
my $parent = shift;
pipe $parent, my $child or die;
my $pid = fork();
die "fork() failed: $!" unless defined $pid;
if ($pid) {
close $child;
}
else {
close $parent;
close STDOUT; # Without this, Win32 may be blocked
open(STDOUT, ">&=" . fileno($child)) or die;
}
$pid;
}
my $fh = gensym;
my $pid = pipe_from_fork($fh);
die if ! defined ($pid);
if(!$pid) {
binmode STDOUT;
( run in 2.181 seconds using v1.01-cache-2.11-cpan-49f99fa48dc )