view release on metacpan or search on metacpan
bench/wrk.pl view on Meta::CPAN
$r->{name}, $r->{rps}, $r->{latency}, $relative;
}
}
print "\n";
print "Note: wrk uses connection pooling (keep-alive) for maximum throughput.\n";
print "Run with: perl bench/wrk.pl [duration] [threads] [connections]\n";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/IO/Async/SSL.pm view on Meta::CPAN
$ready->( $handle );
return $f if defined wantarray;
# Caller is not going to keep hold of the Future, so we have to ensure it
# stays alive somehow
$f->on_ready( sub { undef $f } ); # intentional cycle
}
=head2 SSL_connect
lib/IO/Async/SSL.pm view on Meta::CPAN
}) if $on_ssl_error;
return $f if defined wantarray;
# Caller is not going to keep hold of the Future, so we have to ensure it
# stays alive somehow
$f->on_ready( sub { undef $f } ); # intentional cycle
}
=head2 SSL_listen
lib/IO/Async/SSL.pm view on Meta::CPAN
});
return $f if defined wantarray;
# Caller is not going to keep hold of the Future, so we have to ensure it
# stays alive somehow
$f->on_ready( sub { undef $f } ); # intentional cycle
}
=head1 STREAM PROTOCOL METHODS
view all matches for this distribution
view release on metacpan or search on metacpan
lib/IO/Async/Function.pm view on Meta::CPAN
$future->on_fail( $on_fail ) if $on_fail;
return $future if defined wantarray;
# Caller is not going to keep hold of the Future, so we have to ensure it
# stays alive somehow
$self->adopt_future( $future->else( sub { Future->done } ) );
}
sub _worker_objects
{
view all matches for this distribution
view release on metacpan or search on metacpan
brotli/tests/testdata/alice29.txt view on Meta::CPAN
Alice began to feel very uneasy: to be sure, she had not as
yet had any dispute with the Queen, but she knew that it might
happen any minute, `and then,' thought she, `what would become of
me? They're dreadfully fond of beheading people here; the great
wonder is, that there's any one left alive!'
She was looking about for some way of escape, and wondering
whether she could get away without being seen, when she noticed a
curious appearance in the air: it puzzled her very much at
first, but, after watching it a minute or two, she made it out to
brotli/tests/testdata/alice29.txt view on Meta::CPAN
`I don't think they play at all fairly,' Alice began, in rather
a complaining tone, `and they all quarrel so dreadfully one can't
hear oneself speak--and they don't seem to have any rules in
particular; at least, if there are, nobody attends to them--and
you've no idea how confusing it is all the things being alive;
for instance, there's the arch I've got to go through next
walking about at the other end of the ground--and I should have
croqueted the Queen's hedgehog just now, only it ran away when it
saw mine coming!'
brotli/tests/testdata/alice29.txt view on Meta::CPAN
tiny hands were clasped upon her knee, and the bright eager eyes
were looking up into hers--she could hear the very tones of her
voice, and see that queer little toss of her head to keep back
the wandering hair that WOULD always get into her eyes--and
still as she listened, or seemed to listen, the whole place
around her became alive the strange creatures of her little
sister's dream.
The long grass rustled at her feet as the White Rabbit hurried
by--the frightened Mouse splashed his way through the
neighbouring pool--she could hear the rattle of the teacups as
view all matches for this distribution
view release on metacpan or search on metacpan
lib/IO/EPP/HosterKZ.pm view on Meta::CPAN
#my $cookie = HTTP::Cookies->new;
my $ua = LWP::UserAgent->new(
agent => 'EppBot/7.02 (Perl; Linux i686; ru, en_US)',
parse_head => 0,
#keep_alive => 30,
#cookie_jar => $cookie,
#%ua_params,
);
my $in_data;
view all matches for this distribution
view release on metacpan or search on metacpan
examples/httpclient.pl view on Meta::CPAN
"text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\r\n".
"Accept-Language: en-us,en;q=0.5\r\n".
"Accept-Encoding: gzip,deflate\r\n".
"Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n".
"Keep-Alive: 300\r\n".
"Connection: keep-alive\r\n\r\n";
$mux->send($fh, $HTTP_HDR);
}
view all matches for this distribution
view release on metacpan or search on metacpan
use IO::Events;
my $loop = IO::Events::Loop-> new();
my $stdin_alive = 1;
my $calculator = IO::Events::Process::ReadWrite-> new(
owner => $loop,
process => 'bc -l',
on_read => sub {
while ( my $line = $_[0]-> readline) {
print "bc says: $line";
}
},
on_close => sub {
exit 1 if $stdin_alive; # fork/exec error
}
);
my $stdin = IO::Events::stdin-> new(
owner => $loop,
on_read => sub {
$calculator-> write( $_[0]-> read );
},
on_close => sub {
$stdin_alive = 0;
exit;
},
);
$loop-> yield while 1;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/IO/K8s/Api/Core/V1/Probe.pm view on Meta::CPAN
package IO::K8s::Api::Core::V1::Probe;
# ABSTRACT: Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.
our $VERSION = '1.100';
use IO::K8s::Resource;
k8s exec => 'Core::V1::ExecAction';
lib/IO/K8s/Api/Core/V1/Probe.pm view on Meta::CPAN
=encoding UTF-8
=head1 NAME
IO::K8s::Api::Core::V1::Probe - Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.
=head1 VERSION
version 1.100
view all matches for this distribution
view release on metacpan or search on metacpan
lib/IO/Lambda/Inotify.pm view on Meta::CPAN
of type Linux::Inotify2::Event (exactly as Linux::Inotify2 does), on failure, $event is undefined,
and $error is set.
If $timeout is specified, and expired, $error is set to C<'timeout'>
If no $inotify object is passed, then it is created automatically, and stays alive until
the end of the program. It is also reused for other such calls.
=head2 inotify_server( $inotify, ... ) :: () -> ()
Accepts one or more $inotify objects, creates a lambda that serves as a proxy for Linux::Inotify2
view all matches for this distribution
view release on metacpan or search on metacpan
lib/IO/Lambda/HTTP/Authen/NTLM.pm view on Meta::CPAN
my $r = IO::Lambda::HTTP-> new(
$req,
username => 'moo',
password => 'foo',
keep_alive => 1,
)-> wait;
print ref($r) ? $r-> as_string : $r;
=head1 DESCRIPTION
view all matches for this distribution
view release on metacpan or search on metacpan
t/subprocess.t view on Meta::CPAN
EOF
my $outside_of_pty = `$^X -e '$script'`;
unlike($outside_of_pty, qr/ok/, "running outside of pty fails -t checks");
# we need to keep the script alive until we can read the output from it
$script .= "sleep 1 while 1;";
$pty->spawn("$^X -e '$script'");
like($pty->read, qr/ok/, "runs subprocess in a pty");
$pty->close;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/IO/Socket/DNS.pm view on Meta::CPAN
The Password setting is not implemented yet. So anyone can use your
server without your permission fairly easily and you could be blamed
for any malicious traffic tunnelled through it.
Sockets idle for more than 120 are automatically closed on the
server side. You have to keep probing to keep the connection alive.
Since DNS, for the most part, is UDP, which is a "connectionless"
protocol, IO::Socket::DNS does not implement the FILENO hook for
its TIEHANDLE, so things like IO::Select won't work as expected.
view all matches for this distribution
view release on metacpan or search on metacpan
my $client = $server->accept;
ok( $error_trapped, "Server non-SSL Client Check");
if ($client && $client->opened) {
fail("client stayed alive");
exit;
}
ok( !$client, "Server Kill-client Check");
($client, my $peer) = $server->accept;
view all matches for this distribution
view release on metacpan or search on metacpan
t/03_connect.t view on Meta::CPAN
($s_pid, $s_host, $s_port) = make_socks_server(5);
socket(my $unconnected_sock, $family, SOCK_STREAM, getprotobyname('tcp')) || die "socket: $!";
$sock = IO::Socket::Socks->new_from_socket($unconnected_sock, ProxyAddr => $s_host, ProxyPort => $s_port, ConnectAddr => $h_host, ConnectPort => $h_port);
ok($unconnected_sock, "plain socket still alive");
if (ok($sock, "socks object created from plain socket")) {
is(fileno($sock), fileno($unconnected_sock), "socks object uses plain socket");
}
# without quotes will not work on old perl (<= 5.14?)
$sock = "$IO::Socket::Socks::SOCKET_CLASS"->new(PeerAddr => $s_host, PeerPort => $s_port);
view all matches for this distribution
view release on metacpan or search on metacpan
t/01.export.t
t/author-perlcritic.t
t/author-pod-syntax.t
t/release-distribution.t
t/share.pm
t/uc-1.0-keepalive.t
t/uc-1.0.t
t/uc-1.1-pipelining.t
t/uc-1.1.t
view all matches for this distribution
view release on metacpan or search on metacpan
lib/IO/Stream.pm view on Meta::CPAN
} else {
my $nb=1; ioctl $self->{fh}, FIONBIO, \$nb or croak "ioctl: $!";
}
}
# Keep this object alive, even if user doesn't keep it himself.
$self->{_id} = fileno $self->{fh};
if (!$self->{_id}) {
croak q{can't get file descriptor};
} elsif ($Active[ $self->{_id} ]) {
croak q{can't create second object for same fh};
view all matches for this distribution
view release on metacpan or search on metacpan
t/19-iotrace-slow-fds.t view on Meta::CPAN
chomp($line = <$err_fh>);
ok($line, t." $prog: back5: $line");
like($line, qr{undef}, t." $prog: err finished");
# Test #LineM: p (PAUSE for a second)
# Quick probe to make sure prog is still alive
alarm 5;
my $died = waitpid(-1, WNOHANG);
ok($died<=0, t." $prog: PID[$pid] still running: $died");
# If the PAUSE is working, then STDERR should still be open, but empty
view all matches for this distribution
view release on metacpan or search on metacpan
0.012 2026-02-26 18:52:42+01:00 Europe/Brussels
- Add statx and fstatx functions
0.011 2026-02-05 18:19:20+01:00 Europe/Brussels
- Keep more arguments alive
- Correct iteration over named arguments to new
- Store correct name when probing
0.010 2026-01-17 21:22:33+01:00 Europe/Brussels
- Add submit method
view all matches for this distribution
view release on metacpan or search on metacpan
lib/IOMux/HTTP.pm view on Meta::CPAN
$msg->protocol($proto = HTTP_0_9)
unless $proto;
$self->{IMH_no_more}++
if $msg->protocol lt HTTP_1_1
|| lc($headers->header('Connection') || '') ne 'keep-alive';
$self->{IMH_take_all}++
if $proto lt HTTP_1_0;
return # simply wait until EOF
lib/IOMux/HTTP.pm view on Meta::CPAN
{ my ($self, $msg, $callback) = @_;
my $header = $msg->headers;
$header->push_header
( Date => time2str(time)
, Connection => ($self->{IMH_no_more} ? 'close' : 'keep-alive')
, @{$self->{IMH_headers}}
);
my $content = $msg->content;
if(ref $content eq 'CODE')
view all matches for this distribution
view release on metacpan or search on metacpan
t/02basic.t view on Meta::CPAN
my $limit2 = IPC::ConcurrencyLimit->new(%args);
my $id2 = $limit2->get_lock();
is($id2, undef, 'Cannot get second lock');
ok($limit->heartbeat, 'Lock alive');
SCOPE: {
my $_lock = $limit->{lock_obj}; # breaking encapsulation
is($conn->hget($_lock->key_name, $_lock->id),
$_lock->uuid . "-" . $_lock->proc_info,
"UUID/procinfo ok");
}
is($limit->release_lock(), 1, 'Lock released');
ok(!$limit->heartbeat, 'Lock not alive');
$id2 = $limit2->get_lock();
is($id2, 1, 'Got other lock after first was released');
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/IPC/ConcurrencyLimit.pm view on Meta::CPAN
the same lock id as long as a lock is held.
B<WARNING!> make sure the variable holding the lock remains in scope at all
times, otherwise the lock will be released and locking will become apparently
ineffective. This is the most common reason for having several concurrent
processes running when only one is expected to be alive.
=head2 release_lock
Releases the lock. Returns 1 if a lock has been
released or undef if there had been no lock to be
view all matches for this distribution
view release on metacpan or search on metacpan
lib/IPC/DirQueue.pm view on Meta::CPAN
# active lockfile; it's being worked on. skip this file
next;
}
if ($self->worker_still_working($pathactive)) {
# worker is still alive, although not updating the lock
dbg ("worker still working, skip: $pathactive");
next;
}
# now, we want to try to avoid 2 or 3 dequeuers removing
view all matches for this distribution
view release on metacpan or search on metacpan
lib/IPC/Fork/Simple.pm view on Meta::CPAN
L<process_child_data>. See EXAMPLES for details on the meaning of these flags.
=cut
sub collect_data_from_handler {
my ( $self, $keep_alive, $block ) = @_;
my ( $r, $msg );
if ( !$self->{'handler_pid'} ) { return; }
local $SIG{'PIPE'} = 'IGNORE';
if ( $keep_alive ) {
if ( $block == BLOCK_NEVER ) {
$msg = FLAG_PACKET_GET_CHILD_DATA;
} elsif ( $block == BLOCK_UNTIL_DATA ) {
$msg = FLAG_PACKET_GET_CHILD_DATA_BLOCK;
} elsif ( $block == BLOCK_UNTIL_CHILD ) {
lib/IPC/Fork/Simple.pm view on Meta::CPAN
# FLAG_PACKET_DATA_HANDLER_DATA_CHECKPOINT is received.
do {
$r = $self->_data_from_socket( $self->{'handler_select'}, BLOCK_UNTIL_CHILD );
} until ( $r == FLAG_PACKET_DATA_HANDLER_DATA_CHECKPOINT );
if ( !$keep_alive ) {
# _data_from_socket will return when the remote socket is closed.
$self->_data_from_socket( $self->{'handler_select'}, BLOCK_UNTIL_CHILD );
waitpid( $self->{'handler_pid'}, 0 );
$self->{'handler_pid'} = 0;
}
view all matches for this distribution
view release on metacpan or search on metacpan
as Perl ones, for example.
Example:
objectMode => 1
The transfer mode may be changed while the object is alive by using the
methods I<setObjectMode()> and I<setAsciiMode()>.
=item startblockLength
sets the length of the initial info block which preceds every LDT
view all matches for this distribution
view release on metacpan or search on metacpan
lib/IPC/Lock.pm view on Meta::CPAN
### from File::NFSLock
my $graceful_sig = sub {
print STDERR "Received SIG$_[0]\n" if @_;
# Perl's exit should safely DESTROY any objects
# still "alive" before calling the real _exit().
exit;
};
sub new {
my $type = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/IPC/LockTicket.pm view on Meta::CPAN
=head3 C<MainLock>
my $bolSuccess = $object->MainLock();
my $bolSuccess = $object->MainLock(1);
Checks if a lock file exists and creates it if not. Fails if file exists and process stored within is alive.
If a C<true> value is supplied, locking is non-exclusive but shared. If the file exists and was also created non-exclusively, locking is successful. This way the lock file is shared with several processes, requesting non-exclusive mode.
If C<false> is returned from C<MainLock> no lock file was created/claimed.
Meaning:
____________________________________________________________________________________________________________________________________
lib/IPC/LockTicket.pm view on Meta::CPAN
my %bolTestedParent = ();
local $SIG{CLD} = q{IGNORE};
local $SIG{CHLD} = q{IGNORE};
# if parent was not tested yet test if alive, but we don't test ourself, but any other agent
return(grep { ( $bolTestedParent{$_->{_pidParent}}++ || kill(0 => $_->{_pidParent}) ) && ( $_->{_pidAgent} == $$ || kill(0 => $_->{_pidAgent}) ) } @{$areList});
}
=head3 C<TokenLock>
view all matches for this distribution
view release on metacpan or search on metacpan
NOTES
This module requires perl 5.6 or later.
The initial use of the array functions of this module was to track
related-file accesses on our Apache web server, and thus optimize
use of the HTTP keep-alive feature. Watch CPAN for this module
in the future (its working name is Apache2::CloseKeepAlive).
Craig MacKenna <craig@animalhead.com>
Jan 4 2010
view all matches for this distribution
view release on metacpan or search on metacpan
lib/IPC/Manager/Test.pm view on Meta::CPAN
like($err_resp->{ipcm_error}, qr/request boom/, "Error response contains exception details");
ok(!defined $err_resp->{response}, "Response is undef on error");
# 5) Service still works after all the exceptions
my $resp3 = $handle->sync_request(ie_svc => 'ping');
is($resp3->{response}, 'ok', "Service still alive after all intercepted errors");
$handle = undef;
}
sub test_watch_pids {
lib/IPC/Manager/Test.pm view on Meta::CPAN
ok($err_resp->{ipcm_error}, "Error response has ipcm_error flag");
is($err_resp->{ipcm_error}, 'Internal service error', "Error message is generic");
unlike($err_resp->{ipcm_error}, qr/secret/, "Internal details not exposed");
ok(!defined $err_resp->{response}, "Response is undef on error");
# Service is still alive after the error
my $resp2 = $handle->sync_request(err_generic_svc => 'hello');
is($resp2->{response}, 'ok', "Service still works after error");
$handle = undef;
}
lib/IPC/Manager/Test.pm view on Meta::CPAN
my $err_resp = $handle->sync_request(err_detail_svc => 'crash');
ok($err_resp->{ipcm_error}, "Error response has ipcm_error flag");
like($err_resp->{ipcm_error}, qr/detailed failure info/, "Error exposes exception details");
ok(!defined $err_resp->{response}, "Response is undef on error");
# Service is still alive
my $resp = $handle->sync_request(err_detail_svc => 'hello');
is($resp->{response}, 'ok', "Service still works after detailed error");
$handle = undef;
}
lib/IPC/Manager/Test.pm view on Meta::CPAN
# Reap the middle process so it doesn't linger as a zombie
waitpid($middle_pid, 0) if $middle_pid;
# child_pid on the handle is the first-fork pid from ipcm_service.
# In this daemonize case that is the middle process, which has now
# exited - so it is no longer alive.
my $cpid = $handle->child_pid;
ok($cpid, "Handle carries a child_pid");
is($cpid, $middle_pid, "child_pid == first-fork (middle) pid");
ok(!kill(0, $cpid), "First-fork pid no longer alive after daemonize");
$handle = undef;
}
sub test_child_pid {
# Basic accessor: handle returned by ipcm_service carries the
# first-fork pid, and it is alive while the service is up.
my $handle = ipcm_service(
'child_pid_svc',
class => 'IPC::Manager::Service',
handle_request => sub { return "ok" },
);
my $cpid = $handle->child_pid;
ok($cpid, "Handle has child_pid");
like($cpid, qr/^\d+$/, "child_pid is a positive integer");
ok(kill(0, $cpid), "child_pid is alive while service is up");
# No post_fork_hook: first-fork pid == service pid
is($handle->service_pid, $cpid, "child_pid == service_pid (no post_fork_hook)");
$handle = undef;
lib/IPC/Manager/Test.pm view on Meta::CPAN
);
is($h->child_pid, undef, "Bare handle has undef child_pid");
}
sub test_child_pid_interpose {
# post_fork_hook interpose pattern: first-fork pid stays alive as
# the long-lived "wrapper", and a deeper fork runs the service loop.
# child_pid should equal the wrapper (first-fork) pid, and that pid
# should stay alive as long as the service is up.
my $marker_dir = File::Temp::tempdir(CLEANUP => 1);
my $wrapper_file = File::Spec->catfile($marker_dir, 'wrapper_pid');
my $service_file = File::Spec->catfile($marker_dir, 'service_pid');
lib/IPC/Manager/Test.pm view on Meta::CPAN
my $self = shift;
my $pid = fork // die "Could not fork in post_fork: $!";
if ($pid) {
# Wrapper: record our pid, stay alive, wait for service to exit.
open my $fh, '>', $wrapper_file or die "open: $!";
print $fh "$$\n";
close $fh;
waitpid($pid, 0);
POSIX::_exit(0);
lib/IPC/Manager/Test.pm view on Meta::CPAN
close $sfh;
my $cpid = $handle->child_pid;
is($cpid, $wrapper_pid, "child_pid == wrapper (first-fork) pid");
isnt($cpid, $svc_pid, "Wrapper pid differs from service pid");
ok(kill(0, $cpid), "Wrapper pid alive while service is up");
$handle = undef;
}
1;
lib/IPC/Manager/Test.pm view on Meta::CPAN
=item IPC::Manager::Test->test_child_pid_interpose
Tests the interpose C<post_fork_hook> pattern: the parent becomes a
long-lived wrapper and the deeper child runs the service loop. Verifies
C<child_pid> equals the wrapper pid, differs from the service pid, and that
the wrapper pid stays alive for as long as the service is up.
=back
=head1 SOURCE
view all matches for this distribution
view release on metacpan or search on metacpan
lib/IPC/Run.pm view on Meta::CPAN
## TODO: fix the inheritance of output file descriptors.
## NOTE: This sharing of OPS among kids means that we can't easily put
## a kid number in each OPS structure to ping the kid when all ops
## have closed (when $self->{PIPES} has emptied). This means that we
## need to scan the KIDS whenever @{$self->{PIPES}} is empty to see
## if there any of them are still alive.
for ( my $num = 0; $num < $#{ $self->{KIDS} }; ++$num ) {
for ( reverse @output_fds_accum ) {
next unless defined $_;
_debug(
'kid ', $self->{KIDS}->[$num]->{NUM}, ' also to write ', $_->{KFD},
lib/IPC/Run.pm view on Meta::CPAN
my IPC::Run $self = shift;
## There's a catch-22 we can get in to if there is only one pipe left
## open to the child and it's paused (ie the SCALAR it's tied to
## is ''). It's paused, so we're not select()ing on it, so we don't
## check it to see if the child attached to it is alive and it stays
## in @{$self->{PIPES}} forever. So, if all pipes are paused, see if
## we can reap the child.
return -1 if grep !$_->{PAUSED}, @{ $self->{PIPES} };
## See if the child is dead.
view all matches for this distribution
view release on metacpan or search on metacpan
t/35-clean.t view on Meta::CPAN
my $data = '';
my $id = $s->seg->id;
shmread($id, $data, 0, length('IPC::Shareable'));
is $data, 'IPC::Shareable', "Shared memory alive ok in child";
$s->clean_up;
is shm_cleaned($id), 0, "after clean_up(), all is well ok in child, we don't clean up what isn't ours";
view all matches for this distribution