view release on metacpan or search on metacpan
lib/EV/Redis.pm view on Meta::CPAN
$self->command_timeout($args{command_timeout}) if defined $args{command_timeout};
$self->max_pending($args{max_pending}) if defined $args{max_pending};
$self->waiting_timeout($args{waiting_timeout}) if defined $args{waiting_timeout};
$self->resume_waiting_on_reconnect($args{resume_waiting_on_reconnect}) if defined $args{resume_waiting_on_reconnect};
$self->priority($args{priority}) if defined $args{priority};
$self->keepalive($args{keepalive}) if defined $args{keepalive};
$self->prefer_ipv4($args{prefer_ipv4}) if exists $args{prefer_ipv4};
$self->prefer_ipv6($args{prefer_ipv6}) if exists $args{prefer_ipv6};
$self->source_addr($args{source_addr}) if defined $args{source_addr};
$self->tcp_user_timeout($args{tcp_user_timeout}) if defined $args{tcp_user_timeout};
$self->cloexec($args{cloexec}) if exists $args{cloexec};
lib/EV/Redis.pm view on Meta::CPAN
Priority for the underlying libev IO watchers. Higher priority watchers are
invoked before lower priority ones. Valid range is -2 (lowest) to +2 (highest),
with 0 being the default. See L<EV> documentation for details on priorities.
=item * keepalive => $seconds
Enable TCP keepalive with the specified interval in seconds. When enabled,
the OS will periodically send probes on idle connections to detect dead peers.
0 means disabled (default). Recommended for long-lived connections behind
NAT gateways or firewalls.
=item * prefer_ipv4 => $bool
lib/EV/Redis.pm view on Meta::CPAN
$redis->priority(1); # higher priority
$redis->priority(-1); # lower priority
$redis->priority(99); # clamped to 2
my $prio = $redis->priority; # get current priority
=head2 keepalive($seconds)
Get or set the TCP keepalive interval in seconds. When set, the OS sends
periodic probes on idle connections to detect dead peers. 0 means disabled
(default). When set to a positive value while connected, takes effect
immediately. Setting to 0 while connected records the preference for future
connections but does not disable keepalives on the current socket.
=head2 prefer_ipv4($bool)
Get or set IPv4 preference for DNS resolution. Mutually exclusive with
C<prefer_ipv6> (setting one clears the other). Takes effect on the next
view all matches for this distribution
view release on metacpan or search on metacpan
eg/graceful_shutdown.pl view on Meta::CPAN
on_close => sub { warn "client closed\n" },
);
warn "listening on port $bound; Ctrl-C to shut down\n";
my $shutting_down = 0;
# Keep the watchers alive for the life of the process.
my $sigint = EV::signal('INT', \&graceful_shutdown);
my $sigterm = EV::signal('TERM', \&graceful_shutdown);
sub graceful_shutdown {
return if $shutting_down++;
view all matches for this distribution
view release on metacpan or search on metacpan
eg/keep_alive.pl view on Meta::CPAN
# failures by calling reinit() (which re-reads /etc/resolv.conf) and
# logging fail-over behavior. Intended as a copyable starting point for
# health-check daemons that need cached, periodically-refreshed records.
#
# Usage:
# perl eg/keep_alive.pl # default 30s, defaults to a few hosts
# perl eg/keep_alive.pl 5 cloudflare.com github.com
# ^C to stop
use strict;
use warnings;
use EV;
use EV::cares qw(:all);
view all matches for this distribution
view release on metacpan or search on metacpan
bin/ews_calendar_viewer_server.pl view on Meta::CPAN
-f --fork handle each request in a new process
(defaults to false)
-? --help display this help and exits
-h --host host (defaults to all)
-p --port port (defaults to 3000)
-k --keepalive enable keep-alive connections
-r --restart restart when files get modified
(defaults to false)
-rd --restart_delay delay between file checks
(ignored if you have Linux::Inotify2 installed)
-rr --restart_regex regex match files that trigger
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Elastic/Model/Scope.pm view on Meta::CPAN
=encoding UTF-8
=head1 NAME
Elastic::Model::Scope - Keeps objects alive and connected
=head1 VERSION
version 0.52
lib/Elastic/Model/Scope.pm view on Meta::CPAN
=over
=item *
Keep weak-ref L<Elastic::Doc> attributes alive
=item *
Reuse L<Elastic::Doc> objects as singletons.
lib/Elastic/Model/Scope.pm view on Meta::CPAN
# John
print refaddr($one) == refaddr($three) ? 'TRUE' : 'FALSE';
# TRUE
Object C<$two> still exists, and is still kept alive, but will no longer be
returned from C<$scope_2>.
print $two->name;
# Clint
lib/Elastic/Model/Scope.pm view on Meta::CPAN
=cut
__END__
# ABSTRACT: Keeps objects alive and connected
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Elive/Entity/ServerDetails.pm view on Meta::CPAN
has 'serverDetailsId' => (is => 'rw', isa => 'Str', required => 1);
__PACKAGE__->primary_key('serverDetailsId');
has 'address' => (is => 'rw', isa => 'Str');
has 'alive' => (is => 'rw', isa => 'Bool');
has 'codebase' => (is => 'rw', isa => 'Str');
has 'elsRecordingsFolder' => (is => 'rw', isa => 'Str');
has 'elmRecordingsFolder' => (is => 'rw', isa => 'Str');
has 'encoding' => (is => 'rw', isa => 'Str');
has 'maxSeats' => (is => 'rw', isa => 'Int');
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Email/Find.pm view on Meta::CPAN
print "Found ".$email->format."\n";
return $orig_email;
});
$finder->find(\$text);
# For each email found, ping its host to see if its alive.
require Net::Ping;
$ping = Net::Ping->new;
my %Pinged = ();
my $finder = Email::Find->new(sub {
my($email, $orig_email) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Email/Folder/Exchange/EWS.pm view on Meta::CPAN
}
# build soap accessor
my $soap = SOAP::Lite->proxy(
$uri->as_string,
keep_alive => 1,
credentials => [
$uri->host . ':' . ( $uri->scheme eq 'https' ? '443' : '80' ),
# $uri->host,
'',
$username,
view all matches for this distribution
view release on metacpan or search on metacpan
alexanderthegreat.co.uk
algeria.com
algeriamail.com
alhajj.com
alicemunro.com
aliveandkicking.co.uk
allegation.co.uk
allegedly.co.uk
allergic.co.uk
allergist.com
allmail.net
starwars.mailbr.com.br
starwarsmail.net
statement.co.uk
stateofplay.co.uk
staycool.co.uk
stayinalive.co.uk
stayingin.co.uk
stayintouch.co.uk
stbrendan.com
stbrigid.com
stcolumba.com
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Email/SendGrid/V3.pm view on Meta::CPAN
my $api_key = $args{api_key} || $self->{api_key} or croak "API key is required to send";
my $endpoint = $args{endpoint} || $self->{endpoint} || DEFAULT_ENDPOINT;
my $payload = $self->_payload;
my $http = HTTP::Tiny->new(
keep_alive => 0,
default_headers => {
'Content-Type' => 'application/json',
'Authorization' => "Bearer $api_key",
},
);
view all matches for this distribution
view release on metacpan or search on metacpan
t/request.t view on Meta::CPAN
method => 'get',
version => '1.1',
uri => URI->new('http://something.com/page.html?thing=1'),
header => [
{ name => 'User-Agent', value => 'EntityModel/0.1' },
{ name => 'Keepalive', value => '150' },
]
]);
is($req->method, 'get', 'method is correct');
is($req->path, '/page.html', 'path is correct');
is($req->version, 1.1, 'version is correct');
is($req->hostname, 'something.com', 'host is correct');
is($req->uri->as_string, 'http://something.com/page.html?thing=1', 'URI is correct');
is($req->header_by_name->get('User-Agent')->value, 'EntityModel/0.1', 'UserAgent is correct');
is($req->header_by_name->get('Keepalive')->value, '150', 'Keepalive is correct');
view all matches for this distribution
view release on metacpan or search on metacpan
t/transaction.t view on Meta::CPAN
my $weak_tran;
my $tran = as_transaction {
Scalar::Util::weaken($weak_tran = shift);
};
is_oneref($tran, 'have single ref for transaction');
ok($weak_tran, 'weak transaction still alive');
ok($weak_tran, 'weak transaction still alive');
$weak_tran->();
is_oneref($tran, 'still single ref for transaction');
$tran->commit;
is_oneref($tran, 'still single ref for transaction');
undef $tran;
t/transaction.t view on Meta::CPAN
Scalar::Util::weaken($weak_tran = shift);
} success => sub { is_refcount($_[0], 3, 'refcount correct in success callback') }
, failure => sub { fail("why the failure?") }
, goodbye => sub { is_refcount($_[0], 3, 'refcount correct in goodbye callback') };
is_oneref($tran, 'have single ref for transaction');
ok($weak_tran, 'weak transaction still alive');
ok($weak_tran->(), 'can apply transaction');
ok($weak_tran, 'weak transaction still alive');
is_oneref($tran, 'still single ref for transaction');
ok($tran->commit, 'can commit');
is_oneref($tran, 'still single ref for transaction');
}
{
t/transaction.t view on Meta::CPAN
die;
} success => sub { fail("should not succeed?") },
, failure => sub { is_refcount($_[0], 3, 'refcount correct in failure callback') }
, goodbye => sub { is_refcount($_[0], 3, 'refcount correct in goodbye callback') };
is_oneref($tran, 'have single ref for transaction');
ok($weak_tran, 'weak transaction still alive');
ok($weak_tran->(), 'can apply transaction');
ok($weak_tran, 'weak transaction still alive');
is_oneref($tran, 'still single ref for transaction');
ok($tran->commit, 'can commit');
is_oneref($tran, 'still single ref for transaction');
}
done_testing;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Erlang/Interface.pm view on Meta::CPAN
erl_accept
erl_thiscookie
erl_thisnodename
erl_thishostname
erl_thisalivename
erl_thiscreation
erl_init
erl_length
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Etcd3/Lease.pm view on Meta::CPAN
$self->request;
return $self;
}
=head2 keepalive
LeaseKeepAlive keeps the lease alive by streaming keep alive requests from the client
to the server and streaming keep alive responses from the server to the client."
$etcd->lease({{ ID => 7587821338341002662 })->keepalive
=cut
sub keepalive {
my $self = shift;
$self->{endpoint} = '/lease/keepalive';
confess 'ID is required for ' . __PACKAGE__ . '->keepalive'
unless $self->{ID};
$self->request;
return $self;
}
view all matches for this distribution
view release on metacpan or search on metacpan
c/typemap.c view on Meta::CPAN
static void* sv_2genericsrc(SV *sv) {
return sv_2thing(MG_GENERICSRC_CODE, sv);
}
/*
Events have a short lifetime. mysv is kept alive until the event
has been serviced. Once perl finally releases mysv then the event
is deallocated (or, more likely, recycled).
*/
SV *event_2sv(pe_event *ev) { /**MAKE FAST**/
view all matches for this distribution
view release on metacpan or search on metacpan
handle {
handle {
ok(1, raise bar);
ok(1, raise foo);
ok(1, raise baz3);
ok(1, raise 'still alive');
ok(0, raise quux);
} foo => sub { ok(1, "handle foo"); "ok foo" },
[qw(BAR Bar bar)] => sub { ok(1, "reraise bar"); raise "bar" };
} qr/b.r/ => sub { ok(1, "handle bar"); "ok bar" },
{ baz => 1, baz3 => 1 } => sub { ok(1, "handle baz"); "ok baz" },
'still alive' => 'ooooooh';
};
ok($@ =~ /^quux.*eval/, 'yeah: '.$@);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Expect.pm view on Meta::CPAN
CONNECT_LOOP:
# Go until we have a reason to stop
while (1) {
# test each handle to see if it's still alive.
foreach my $read_handle (@handles) {
waitpid( ${*$read_handle}{exp_Pid}, WNOHANG )
if ( exists( ${*$read_handle}{exp_Pid} )
and ${*$read_handle}{exp_Pid} );
if ( exists( ${*$read_handle}{exp_Pid} )
lib/Expect.pm view on Meta::CPAN
=item $object->restart_timeout_upon_receive(0 | 1)
If this is set to 1, the expect timeout is retriggered whenever something
is received from the spawned command. This allows to perform some
aliveness testing and still expect for patterns.
$exp->restart_timeout_upon_receive(1);
$exp->expect($timeout,
[ timeout => \&report_timeout ],
[ qr/pattern/ => \&handle_pattern],
);
Now the timeout isn't triggered if the command produces any kind of output,
i.e. is still alive, but you can act upon patterns in the output.
=item $object->notransfer(1 | 0)
Do not truncate the content of the accumulator after a match.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Exporter/Almighty.pm view on Meta::CPAN
},
const => {
colours => { RED => 'red', BLUE => 'blue', GREEN => 'green' },
},
enum => {
Status => [ 'dead', 'alive' ],
},
also => [
'strict',
'Scalar::Util' => [ 'refaddr' ],
'warnings',
lib/Exporter/Almighty.pm view on Meta::CPAN
This is a hashref where keys are enumerated type names, and the values are
arrayrefs of strings.
use Exporter::Almighty -setup => {
enum => {
Status => [ 'dead', 'alive' ],
},
};
A user of the package defined in the L</SYNOPSIS> could import:
view all matches for this distribution
view release on metacpan or search on metacpan
scripts/fcgicli.pl
t/00_compile.t
t/fcgi/big_post.fcgi
t/fcgi/fcgi.rb
t/fcgi/hello.fcgi
t/fcgi/keepalive.fcgi
t/fcgi/post.fcgi
t/fcgi/ruby.rb
t/fcgi/timeout.fcgi
t/lib/t/Internal.pm
xt/010_live/00_hello.t
view all matches for this distribution
view release on metacpan or search on metacpan
lib/FCGI/EV.pm view on Meta::CPAN
return;
}
sub DESTROY {
my ($self) = @_;
$self->{handler} = undef; # call handler's DESTROY while $self is alive
return;
}
sub stdout {
my ($self, $stdout, $is_eof) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/FFI/Platypus/Type/WideString.pm view on Meta::CPAN
# ABSTRACT: Platypus custom type for Unicode "wide" strings
our $VERSION = '2.11'; # VERSION
my @stack; # To keep buffer alive.
sub _compute_wide_string_encoding
{
foreach my $need (qw( wcslen wcsnlen ))
{
view all matches for this distribution
view release on metacpan or search on metacpan
lib/FIX/Lite.pm view on Meta::CPAN
foreach my $client (keys %{$MD}) {
if (defined $sessions{$client}) {
my $socket;
foreach my $sck ($clnSel->can_write(0)) {
if ($sessions{$client} eq $sck->peerhost().':'.$sck->peerport()) {
print "Found alive socket ".$sck->peerhost().':'.$sck->peerport().' for client '.$client."\n" if ($arg{Debug});
$socket = $sck;
last;
}
}
if (! defined $socket) {
view all matches for this distribution
view release on metacpan or search on metacpan
}
setstate 'working';
_do_req $c;
$c->{client_sock} = $c->{fcgi_obj} = undef if !($c->{fcgi_obj} && $c->{fcgi_obj}->keepalive);
$count++;
passclient if $c->{max_reqs} && $count >= $c->{max_reqs};
}
}
./your-script.pl --http=unix:/path/to/socket
B<WARNING:> The built-in HTTP server is only intended for local development
setups, it is NOT suitable for production deployments. It has no timeouts, does
not enforce limits on request size, does not support HTTPS and will never
adequately support keep-alive. You could put it behind a reverse proxy, but it
currently also lacks provisions for extracting the client IP address from the
request headers, so that's not ideal either. Much better to use FastCGI in
combination with a proper web server for internet-facing deployments.
=item FU_FCGI=addr
this option is set, it takes precedence over the HTTP option.
Nginx and Apache will, in their default configuration, use a separate
connection per request. If you have a more esoteric setup, you should probably
be aware of the following: this implementation does not support multiplexing or
pipelining. It does support keepalive, but this comes with a few caveats:
=over
=item * You should not attempt to keep more connections alive than the
configured number of worker processes, otherwise new connection attempts will
stall indefinitely.
=item * When using C<--monitor> mode, the file modification check is performed
I<after> each request rather than before, so clients may get a response from
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Facebook/OpenGraph.pm view on Meta::CPAN
my $fb = Facebook::OpenGraph->new;
$fb->post('/me/feed', +{message => 'Hello, world!'});
#2500:- OAuthException:An active access token must be used to query information about the current user.
#POST /me/feed HTTP/1.1
#Connection: keep-alive
#User-Agent: Furl::HTTP/2.15
#Content-Type: application/x-www-form-urlencoded
#Content-Length: 27
#Host: graph.facebook.com
#
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Ftree/FamilyTreeBase.pm view on Meta::CPAN
return $self->{cgi}->img(
{
-border => $self->{imgwidth} / 15,
-src => $picture_file,
-class => $person->get_is_living() ? 'alive' : 'dead',
-alt => ( defined $person->get_name() )
? $person->get_name()->get_full_name()
: 'UNKNOWN',
-width => $self->{imgwidth},
-height => $self->{imgheight}
view all matches for this distribution
view release on metacpan or search on metacpan
eg/run_1.pl view on Meta::CPAN
# Stop the process watchdog
$loop->remove($interval);
}
else {
say "Still alive!";
}
}
);
# Start event loop if necessary
view all matches for this distribution
view release on metacpan or search on metacpan
england.rss view on Meta::CPAN
<title>'Sex predator coach abused my karate dream'</title>
<description>A victim of jailed karate instructor Andrew Sherry says he was manipulated and abused by the coach.</description>
<link>https://www.bbc.com/news/articles/cn0v6727vr9o</link>
</item>
<item rdf:about="https://www.bbc.com/news/articles/cxe93ppp3jvo">
<title>TikTok star's mum to keep daughter's name alive</title>
<description>Leah Smith's mother says her memory will live on in a charity to help families dealing with cancer.</description>
<link>https://www.bbc.com/news/articles/cxe93ppp3jvo</link>
</item>
<item rdf:about="https://www.bbc.com/news/articles/c2x3k2zgnjro">
<title>Girl killed by food delivery driver 'had big dreams'</title>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Feersum.pm view on Meta::CPAN
=item C<< set_server_name_and_port($host,$port) >>
Override Feersum's notion of what SERVER_HOST and SERVER_PORT should be.
=item C<< set_keepalive($bool) >>
Override Feersum's default keepalive behavior.
=back
=cut
lib/Feersum.pm view on Meta::CPAN
Using the event loop is "nicer" but perhaps introduces latency, hence this
option.
=item KEEPALIVE_CONNECTION
Controls support of keepalive connections. Default is false.
If enabled or set via Feersum->set_keepalive(1), then
"Connection: keep-alive" for HTTP/1.0 and "Connection: close" for HTTP/1.1
are acknowledged.
=item READ_TIMEOUT
Controls read timeout. Default is 5.0 sec. It is also an keepalive timeout.
=item FEERSUM_IOMATRIX_SIZE
Controls the size of the main write-buffer structure in Feersum. Making this
value lower will use slightly less memory per connection at the cost of speed
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AptFetch.pm view on Meta::CPAN
=cut
=head1 DIAGNOSTICS
Most error communication is done through give-up codes.
However, some conditions aren't worth of keeping process alive -- those are
marked as B<(fatal)>.
Others are (mostly) in just B<fork>ed process that just couldn't boot
properly -- those are communicated back (somehow).
=over
view all matches for this distribution
view release on metacpan or search on metacpan
lib/File/Download.pm view on Meta::CPAN
my $self = shift;
my ($url) = @_;
my $file;
$self->{user_agent} = LWP::UserAgent->new(
agent => "File::Download/$VERSION ",
keep_alive => 1,
env_proxy => 1,
) if !$self->{user_agent};
my $ua = $self->{user_agent};
my $res = $ua->request(HTTP::Request->new(GET => $url),
sub {
view all matches for this distribution