view release on metacpan or search on metacpan
lib/Asterisk/CoroManager.pm view on Meta::CPAN
my $ping = $astman->sendcommand({ Action => 'Ping' }, { timeout => '2' });
if( $ping ) {
# $ping->{Response} should be 'Pong'
print "Yay, we're alive! We got ". $ping->{Response} ."\n";
}
else {
print "Got no pong in 2 seconds :-(\n";
}
lib/Asterisk/CoroManager.pm view on Meta::CPAN
=head2 check_connection
$astman->check_connection();
Checks if the connection is still alive. Tries to reconnect if it
isn't.
=cut
sub check_connection {
view all matches for this distribution
view release on metacpan or search on metacpan
t/metrics.t-lwp-mock.out view on Meta::CPAN
"query" : "",
"scheme" : "https"
}
},
"response" : {
"body" : "HTTP/1.1 200 OK\r\nAccess-Control-Allow-Credentials: true\r\nAccess-Control-Allow-Origin: http://0.0.0.0:8000\r\nConnection: keep-alive\r\nContent-Length: 4531\r\nContent-Security-Policy: default-src 'self'; object-src 'none'\r\nCo...
"class" : "Mojo::Message::Response"
},
"txn_num" : 0
},
{
t/metrics.t-lwp-mock.out view on Meta::CPAN
"query" : "",
"scheme" : "https"
}
},
"response" : {
"body" : "HTTP/1.1 200 OK\r\nAccess-Control-Allow-Credentials: true\r\nAccess-Control-Allow-Origin: http://0.0.0.0:8000\r\nConnection: keep-alive\r\nContent-Length: 772\r\nContent-Security-Policy: default-src 'self'; object-src 'none'\r\nCon...
"class" : "Mojo::Message::Response"
},
"txn_num" : 1
},
{
t/metrics.t-lwp-mock.out view on Meta::CPAN
"query" : "",
"scheme" : "https"
}
},
"response" : {
"body" : "HTTP/1.1 200 OK\r\nAccess-Control-Allow-Credentials: true\r\nAccess-Control-Allow-Origin: http://0.0.0.0:8000\r\nConnection: keep-alive\r\nContent-Length: 3797\r\nContent-Security-Policy: default-src 'self'; object-src 'none'\r\nCo...
"class" : "Mojo::Message::Response"
},
"txn_num" : 2
},
{
t/metrics.t-lwp-mock.out view on Meta::CPAN
"query" : "",
"scheme" : "https"
}
},
"response" : {
"body" : "HTTP/1.1 200 OK\r\nAccess-Control-Allow-Credentials: true\r\nAccess-Control-Allow-Origin: http://0.0.0.0:8000\r\nConnection: keep-alive\r\nContent-Length: 2607\r\nContent-Security-Policy: default-src 'self'; object-src 'none'\r\nCo...
"class" : "Mojo::Message::Response"
},
"txn_num" : 3
}
]
view all matches for this distribution
view release on metacpan or search on metacpan
Constants/Constants.pm view on Meta::CPAN
use constant TYPE_GRB_COORDS => 1;
# Test coords packet
use constant TYPE_TEST_COORDS => 2;
# I'm_alive packet
use constant TYPE_IM_ALIVE => 3;
# Kill a socket connection packet
use constant TYPE_KILL_SOCKET => 4;
view all matches for this distribution
view release on metacpan or search on metacpan
my $t = Expect->spawn('cl') || croak "Cannot spawn CL: $!";
$t->expect(30,'-re',$self->{'cl_prompt'});
croak "Did not get CL prompt after starting up" if $t->error;
$self->{'dead'} = 0; # It is now alive.
my $output = $t->before();
my @output = split /\n/,$output;
if ($self->{'display_startup'}){
for (@output){print STDOUT $_ . "\n"}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Async/Event/Interval.pm view on Meta::CPAN
_events_write(sub { $events{$self->id}{_stop_requested} = 1 });
# Try graceful SIGTERM first so a user-installed SIGTERM handler in the
# callback can do cleanup (close files, release locks, etc.).
# Escalate to SIGKILL if the child is still alive after STOP_TERM_TIMEOUT
# _signal_and_wait polls at STOP_KILL_POLL_INTERVAL and returns 1 as
# soon as the process is gone, so the common case is a single poll.
return if $self->_signal_and_wait('TERM', STOP_TERM_TIMEOUT);
lib/Async/Event/Interval.pm view on Meta::CPAN
# External access: These allow unit tests to directly access live data in the
# %events hash
sub _events_count {
# Number of events currently alive
return _events_read(sub { $events{_event_count} || 0 });
}
sub _events_knot {
# The IPC::Shareable knot itself
return tied(%events);
view all matches for this distribution
view release on metacpan or search on metacpan
root/static/example_openapi.yaml view on Meta::CPAN
'/hcheck':
get:
description: 'Returns a 200 response and Perl package name as text when the service is available'
responses:
200:
description: 'alive'
content:
'text/plain':
example: "Service-name: async-microservice-time\nAPI-version: 1"
405:
$ref: '#/components/responses/Method-Not-Allowed'
view all matches for this distribution
view release on metacpan or search on metacpan
examples/pagi-chat/public/js/app.js view on Meta::CPAN
state.ws.onopen = () => {
setConnectionStatus('connected');
state.reconnectAttempts = 0;
state.lastPongTime = Date.now();
// Start keepalive ping interval
if (state.pingInterval) {
clearInterval(state.pingInterval);
}
state.pingInterval = setInterval(() => {
if (state.ws && state.ws.readyState === WebSocket.OPEN) {
examples/pagi-chat/public/js/app.js view on Meta::CPAN
showToast(data.message, 'error');
break;
case 'pong':
case 'server_ping':
// Keepalive messages - no action needed
break;
case 'stats':
updateStats(data);
break;
examples/pagi-chat/public/js/app.js view on Meta::CPAN
// Visibility change - send ping when tab becomes visible
// This helps prevent disconnects from browser throttling background tabs
document.addEventListener('visibilitychange', () => {
if (document.visibilityState === 'visible') {
// Tab became visible - send immediate ping to keep connection alive
if (state.ws && state.ws.readyState === WebSocket.OPEN) {
sendMessage({ type: 'ping' });
}
}
});
view all matches for this distribution
view release on metacpan or search on metacpan
sub make_use_of {
my ($self) = @_;
push $self->{events}, "make_use_of";
fail "We're not supposed to be alive" if $self->{closed};
}
sub release {
my ($self) = @_;
#
# This race condition should be allowed so long as the resource is still valid,
# but Async::ResourcePool may never dispatch it (there's a test below for
# that).
#
die "We're not supposed to be alive in release:\n@{$self->{events}}"
if $self->{closed};
$self->{pool}->release($self);
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/30-error.t view on Meta::CPAN
my ($in) = @_;
$fired = 1;
ok(!defined($in), "condition input is undef.");
return 1;
});
is(int($s->watchers), 1, "watcher is alive");
$s->trigger('a');
is($fired, 1, "watcher fired.");
is(int($s->watchers), 1, "watcher is alive. cancel() is not called in the watcher callback.");
}
{
note('--- unregister() non-existent resource');
my $s = new_ok('Async::Selector');
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Async/Simple/Task/Fork.pm view on Meta::CPAN
# Return for master process
# Only child tasks must go down and make a loop
return $self if $self->pid;
# Child loop: untill parent is alive
while ( 1 ) {
$self->clear_answer;
$self->get;
unless ( $self->has_answer ) {
view all matches for this distribution
view release on metacpan or search on metacpan
}
});
$fh->start();
B<Note:> The Firehose requires L<Codec::CBOR> and an async event loop to keep the connection alive. Currently, At.pm
supports L<Mojo::UserAgent> so you should usually use L<Mojo::IOLoop>:
use Mojo::IOLoop;
# ... setup firehose ...
Mojo::IOLoop->start unless Mojo::IOLoop->is_running;
view all matches for this distribution
view release on metacpan or search on metacpan
t/truncated_mixed.t view on Meta::CPAN
syswrite($w->wh, substr($wire, 0, $cut)) or die "syswrite: $!";
$r->blocking(0);
my ($err, @got) = one_call($r);
unlike($err, qr/DEADLINE/, "the call returned instead of spinning");
is($err, '', "no exception while the writer is still alive");
ok(!@got, "returned empty: nothing complete yet, caller may retry");
# Deliver the rest; the reassembled message must come through intact.
syswrite($w->wh, substr($wire, $cut)) or die "syswrite: $!";
($err, @got) = one_call($r);
view all matches for this distribution
view release on metacpan or search on metacpan
use Attribute::TieClasses;
use Test::More tests => 1;
my $st : __TEST;
my @st : __TEST;
my %st : __TEST;
pass('still alive (well, it compiled)');
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Audio/AMaMP.pm view on Meta::CPAN
$message{'parameters'} = \%params;
return %message;
}
# This sub checks if the core is still alive/available.
sub isCoreAlive {
# Just call C function to check.
my ($self) = @_;
return amampIsCoreAlive($self->{'core'});
}
lib/Audio/AMaMP.pm view on Meta::CPAN
=item isCoreAlive
print "Core has not terminated" if $amamp->isCoreAlive;
Checks if the AMaMP core is still "alive", e.g. if it has terminated.
If it has terminated, 0 is returned. If it is still alive, a non-zero
value is returned. Note that just because the core is no longer alive
does not mean there are no messages left to read.
=head1 SEE ALSO
AMaMP has a website at L<http://amamp.sourceforge.net/>, which has
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Audio/RPLD.pm view on Meta::CPAN
=head3 $res = $rpld-E<gt>noop()
Send a NOOP command to the server.
This can be used to ping the server or for keep-alive.
=cut
# -- server info:
view all matches for this distribution
view release on metacpan or search on metacpan
examples/js/jquery-1.9.1.js view on Meta::CPAN
return "script";
}
});
var xhrCallbacks, xhrSupported,
xhrId = 0,
// #5280: Internet Explorer will keep connections alive if we don't abort on unload
xhrOnUnloadAbort = window.ActiveXObject && function() {
// Abort all pending requests
var key;
for ( key in xhrCallbacks ) {
xhrCallbacks[ key ]( undefined, true );
view all matches for this distribution
view release on metacpan or search on metacpan
t/35-xml-sig-units.t view on Meta::CPAN
<Name>Bob</Name><!-- no surname -->
<DateOfBirth>1954-03-21</DateOfBirth>
</Identity>
</Assertion>
<Unsafe>
<Assertion>Elvis is alive</Assertion>
</Unsafe>
</Container>
};
$xc = parse_xml_to_xc($xml, @ns_ds);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Authen/Simple/HTTP.pm view on Meta::CPAN
agent => {
type => Params::Validate::OBJECT,
isa => 'LWP::UserAgent',
default => LWP::UserAgent->new(
cookie_jar => {},
keep_alive => 1,
timeout => 30
),
optional => 1
}
});
view all matches for this distribution
view release on metacpan or search on metacpan
smbval/rfcnb-io.c view on Meta::CPAN
{ int read_len, pkt_len;
char hdr[RFCNB_Pkt_Hdr_Len]; /* Local space for the header */
struct RFCNB_Pkt *pkt_frag;
int more, this_time, offset, frag_len, this_len;
BOOL seen_keep_alive = TRUE;
/* Read that header straight into the buffer */
if (len < RFCNB_Pkt_Hdr_Len) { /* What a bozo */
smbval/rfcnb-io.c view on Meta::CPAN
RFCNB_errno = RFCNBE_BadParam;
return(RFCNBE_Bad);
}
/* We discard keep alives here ... */
if (RFCNB_Timeout > 0)
alarm(RFCNB_Timeout);
while (seen_keep_alive) {
if ((read_len = read(con -> fd, hdr, sizeof(hdr))) < 0) { /* Problems */
#ifdef RFCNB_DEBUG
fprintf(stderr, "Reading the packet, we got:");
perror("");
smbval/rfcnb-io.c view on Meta::CPAN
fprintf(stderr, "RFCNB KEEP ALIVE received\n");
#endif
}
else {
seen_keep_alive = FALSE;
}
}
/* What if we got less than or equal to a hdr size in bytes? */
view all matches for this distribution
view release on metacpan or search on metacpan
bin/apache/site_perl/Apache/Toe.pm view on Meta::CPAN
my $reply = $c->getEvent( AW_INFINITE );
if ( ($eventTypeName = $reply->getTypeName) eq "Adapter::ack" ) {
#
# Adapter is alive, proceed:
#
if ( my $cgiBoard = $r->param( 'board' ) ) {
$cgiBoard =~ s/([eXO])/'$1'/g;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AxKit2/Connection.pm view on Meta::CPAN
use AxKit2::HTTPHeaders;
use AxKit2::Constants;
use AxKit2::Utils qw(http_date);
use fields qw(
alive_time
create_time
headers_string
headers_in
headers_out
ditch_leading_rn
lib/AxKit2/Connection.pm view on Meta::CPAN
http_headers_sent
notes
sock_closed
pause_count
continuation
keep_alive_count
);
use constant KEEP_ALIVE_MAX => 100;
use constant CLEANUP_TIME => 5; # every N seconds
use constant MAX_HTTP_HEADER_LENGTH => 102400; # 100k
lib/AxKit2/Connection.pm view on Meta::CPAN
$self = fields::new($self) unless ref($self);
$self->SUPER::new($sock);
my $now = time;
$self->{alive_time} = $self->{create_time} = $now;
$self->{headers_string} = '';
$self->{closed} = 0;
$self->{ditch_leading_rn} = 0; # TODO - work out how to set that...
$self->{server_config} = $servconf;
$self->{keep_alive_count} = 0;
$self->{notes} = {};
$self->log(LOGINFO, "Connection from " . $self->peer_addr_string);
$self->hook_connect();
lib/AxKit2/Connection.pm view on Meta::CPAN
sub event_hup { my AxKit2::Connection $self = shift; $self->close("Disconnect (HUP)") }
sub close { my AxKit2::Connection $self = shift; $self->{sock_closed}++; $self->{notes} = undef; $self->SUPER::close(@_) }
sub event_read {
my AxKit2::Connection $self = shift;
$self->{alive_time} = time;
if ($self->{headers_in}) {
# already got the headers... do we get a body too?
my $bref = $self->read(8192);
return $self->close($!) unless defined $bref;
lib/AxKit2/Connection.pm view on Meta::CPAN
$self->hook_post_read_request($self->{headers_in});
}
sub event_write {
my AxKit2::Connection $self = shift;
$self->{alive_time} = time;
if ($self->hook_write_body_data) {
return;
}
lib/AxKit2/Connection.pm view on Meta::CPAN
my $hd = $self->{headers_in};
$self->initialize_response($hd);
no warnings 'uninitialized';
if ($hd->header('Connection') =~ /\bkeep-alive\b/i) {
# client asked for keep alive. Do we?
$self->{keep_alive_count}++;
if ($self->{keep_alive_count} > KEEP_ALIVE_MAX) {
$self->{headers_out}->header(Connection => 'close');
}
else {
$self->{headers_out}->header(Connection => 'Keep-Alive');
$self->{headers_out}->header('Keep-Alive' =>
"timeout=" . $self->max_idle_time .
", max=" . (KEEP_ALIVE_MAX - $self->{keep_alive_count}));
}
}
# This starts off the chain reaction of the main state machine
$self->hook_uri_translation($hd, $hd->request_uri);
lib/AxKit2/Connection.pm view on Meta::CPAN
return 0 if $self->{sock_closed};
# close if we're supposed to
if (
! defined $self->{headers_out} ||
! $self->{headers_out}->res_keep_alive($self->{headers_in})
)
{
# do a final read so we don't have unread_data_waiting and RST
# the connection. IE and others send an extra \r\n after POSTs
my $dummy = $self->read(5);
# close if we have no response headers or they say to close
$self->close("no_keep_alive");
return 0;
}
# if they just did a POST, set the flag that says we might expect
# an unadvertised \r\n coming from some browsers. Old Netscape
lib/AxKit2/Connection.pm view on Meta::CPAN
# we will recork when we're processing a new request.
# TODO: Disabled because this seemed mostly relevant to Perlbal...
$self->tcp_cork(0);
# reset state
$self->{alive_time} = $self->{create_time} = time;
$self->{headers_string} = '';
$self->{headers_in} = undef;
$self->{headers_out} = undef;
$self->{http_headers_sent} = 0;
$self->{notes} = {};
lib/AxKit2/Connection.pm view on Meta::CPAN
push @to_close, $v;
next;
}
}
if (my $t = $max_age{$ref}) {
if ($v->{alive_time} < $now - $t) {
push @to_close, $v;
}
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
call_sv((SV*)destructor, G_DISCARD|G_EVAL|G_KEEPERR|G_VOID);
POPSTACK;
SPAGAIN;
LEAVE;
if(SvREFCNT(tmpref) < 2) {
/* tmpref is not kept alive! */
SvREFCNT(sv)--;
SvRV_set(tmpref, NULL);
SvROK_off(tmpref);
}
SvREFCNT_dec(tmpref);
view all matches for this distribution
view release on metacpan or search on metacpan
#if DBVER >= 403
DB_SEQUENCE *seq;
db_seq_t seq_t;
#endif
SV *rsv1, *rsv2; // keep some request objects alive
} bdb_cb;
typedef bdb_cb *bdb_req;
enum {
view all matches for this distribution
view release on metacpan or search on metacpan
etc/xfb_2_00.xsd view on Meta::CPAN
schemaLocation="network_elements_2_00.xsd" />
<xsd:element name="OPEN" type="xfb:open_type" />
<xsd:element name="UPDATE" type="xfb:update_type" />
<xsd:element name="NOTIFICATION" type="xfb:notification_type" />
<xsd:element name="KEEP_ALIVE" type="xfb:keepalive_type" />
<xsd:complexType name="open_type">
<xsd:sequence>
etc/xfb_2_00.xsd view on Meta::CPAN
<xsd:attribute name="code" type="xsd:integer" />
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="keepalive_type">
<xsd:attribute name="bgp_message_type" type="xsd:integer"
fixed="4" use="required" />
</xsd:complexType>
<!-- This section defines the optional parameters in an open message https://tools.ietf.org/html/rfc5492 -->
view all matches for this distribution
view release on metacpan or search on metacpan
etc/xfb_2_00.xsd view on Meta::CPAN
schemaLocation="network_elements_2_00.xsd" />
<xsd:element name="OPEN" type="xfb:open_type" />
<xsd:element name="UPDATE" type="xfb:update_type" />
<xsd:element name="NOTIFICATION" type="xfb:notification_type" />
<xsd:element name="KEEP_ALIVE" type="xfb:keepalive_type" />
<xsd:complexType name="open_type">
<xsd:sequence>
etc/xfb_2_00.xsd view on Meta::CPAN
<xsd:attribute name="code" type="xsd:integer" />
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="keepalive_type">
<xsd:attribute name="bgp_message_type" type="xsd:integer"
fixed="4" use="required" />
</xsd:complexType>
<!-- This section defines the optional parameters in an open message https://tools.ietf.org/html/rfc5492 -->
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Backblaze/B2V2Client.pm view on Meta::CPAN
'application_key' => $application_key,
'mech' => WWW::Mechanize->new(
timeout => 60,
autocheck => 0,
cookie_jar => {},
keep_alive => 1,
),
}, $class;
# now start our B2 session via method below
$self->b2_authorize_account(); # this adds more goodness to $self for use in the other methods
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Badger/Hub.pm view on Meta::CPAN
maintain a reference back to the hub. This allows them to access other
sub-systems and components that they require.
Note that this behaviour implicitly creates circular references between the
hub and its delegates. This is intentional. It ensures that the hub and
delegates keep each other alive until the hub is explicitly destroyed and the
references are freed. Having the hub stick around for as long as possible is
usually a Good Thing. It acts as a singleton providing a central point of
access to the resources that your application uses (which is a fancy way of
saying it's like a global variable).
lib/Badger/Hub.pm view on Meta::CPAN
If you manually create a hub for whatever reason (and the cases where you
would need to are few and far between) then you are responsible for calling
the L<destroy()> method when you're done with it. This will manually break
the circular references and free up any memory used by the hub and any
delegates it is using. If you don't call the L<destroy()> method then the
hub will remain alive until the end of the program when the memory will be
freed as usual. In most cases this is perfectly acceptable.
However, you generally don't need to worry about any of this because you
wouldn't normally create a hub manually. Instead, you would leave it up to the
L<Badger> façade (or I<"front-end">) module to do that behind the scenes. When
view all matches for this distribution
view release on metacpan or search on metacpan
lib/BalanceOfPower/Role/WebMaster.pm view on Meta::CPAN
}
sub server_available
{
my $self = shift;
my $alive = $self->get_web_data('/keepalive', 1);
if($alive && $alive eq 'OK')
{
return 1;
}
else
{
view all matches for this distribution
view release on metacpan or search on metacpan
lib/BarefootJS.pm view on Meta::CPAN
# defaults for siblings.
sub register_components_from_manifest ($self, $manifest, %opts) {
my $signal_inits = $opts{signal_init} // {};
my $parent_scope = $self->_scope_id;
# Weaken the parent capture so the child-renderer closures stored on
# `$self->_child_renderers` don't keep `$self` alive (the direct
# closure <-> parent cycle). The controller is reached through `$parent`
# at call time rather than captured strongly here, so the closures hold
# no strong reference to `$c` either â see the controller-cycle note in
# `new`. `$parent` is always live whenever a closure runs (the closure is
# stored on `$parent`, so `$parent` outlives every invocation).
view all matches for this distribution