view release on metacpan or search on metacpan
bin/epfl-net-ssl-test view on Meta::CPAN
while ( not $host = $labs->analyze( host => $domain )->complete() ) {
sleep $labs->previous_eta();
}
if ( $host->ready() ) {
foreach my $endpoint ( $host->endpoints() ) {
if ( $endpoint->ready() ) {
print "\n", $endpoint->ip_address(), "\n"
or croak "Couldn't write: $OS_ERROR";
print color('green'), 'â Diode', "\n", color('clear')
or croak "Couldn't write: $OS_ERROR";
print color('green'), 'â SSL Certificate', "\n", color('clear')
or croak "Couldn't write: $OS_ERROR";
if ( $endpoint->grade() eq 'A' or $endpoint->grade() eq 'A+' ) {
print color('green'), 'â Grade ', $endpoint->grade(), "\n\n",
color('clear')
or croak "Couldn't write: $OS_ERROR";
}
else {
print color('red'), 'â Grade ', $endpoint->grade(), "\n\n",
color('clear')
or croak "Couldn't write: $OS_ERROR";
}
}
else {
view all matches for this distribution
view release on metacpan or search on metacpan
#!/usr/bin/env perl
# TLS connection â connect over a TLS-fronted ClickHouse port.
#
# Set up a TLS endpoint (e.g. with stunnel or nginx) and point this script
# at it via CLICKHOUSE_TLS_HOST / CLICKHOUSE_TLS_PORT.
use strict;
use warnings;
use EV;
use EV::ClickHouse;
view all matches for this distribution
view release on metacpan or search on metacpan
use EV::Etcd;
# Check if etcd is running
my $etcd_running = 0;
eval {
my $result = `etcdctl endpoint health 2>&1`;
$etcd_running = 1 if $result =~ /is healthy/;
};
die "etcd not running\n" unless $etcd_running;
my $client = EV::Etcd->new(
endpoints => ['127.0.0.1:2379'],
);
my $prefix = "/bench_$$";
my $iterations = $ENV{BENCH_ITER} || 1000;
view all matches for this distribution
view release on metacpan or search on metacpan
eg/etcd_series.pl view on Meta::CPAN
use feature 'say';
# Initialize Etcd client
# Note: Ensure etcd is running on localhost:2379
my $etcd = EV::Etcd->new(
endpoints => ['127.0.0.1:2379'],
);
my @steps = (
{ key => '/config/step1', val => 'init' },
{ key => '/config/step2', val => 'processing' },
view all matches for this distribution
view release on metacpan or search on metacpan
deps/hiredis/README.md view on Meta::CPAN
}
}
```
One can also use `redisConnectWithOptions` which takes a `redisOptions` argument
that can be configured with endpoint information as well as many different flags
to change how the `redisContext` will be configured.
```c
redisOptions opt = {0};
/* One can set the endpoint with one of our helper macros */
if (tcp) {
REDIS_OPTIONS_SET_TCP(&opt, "localhost", 6379);
} else {
REDIS_OPTIONS_SET_UNIX(&opt, "/tmp/redis.sock");
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/26_connect_error_reentry.t view on Meta::CPAN
use EV::Memcached;
use FindBin;
use lib "$FindBin::Bin/lib";
use FakeMemcached;
# A synchronous failure handler can choose a healthy replacement endpoint.
for my $reconnect (0, 1) {
my $srv = FakeMemcached->new(script => sub {
my $c = FakeMemcached->accept(shift);
my $r = $c->read_request or exit 0;
$c->respond_hit(op => $r->[0], opaque => $r->[1], value => 'healthy');
view all matches for this distribution
view release on metacpan or search on metacpan
eg/health_checker.pl view on Meta::CPAN
host => $ENV{NATS_HOST} // '127.0.0.1',
port => $ENV{NATS_PORT} // 4222,
on_error => sub { warn "nats: @_\n" },
on_connect => sub {
if ($mode eq 'service' || $mode eq 'both') {
# Register health endpoint
$nats->subscribe("health.$name", sub {
my ($subj, $payload, $reply) = @_;
return unless $reply;
# Simulate health: 90% healthy, 10% degraded
my $status = rand() < 0.9 ? 'healthy' : 'degraded';
$nats->publish($reply, "$name:$status:$$:" . int(rand(100)) . "ms");
});
print "service '$name' registered health endpoint\n";
if ($mode eq 'both') {
# Also register a second service for demo
$nats->subscribe("health.db", sub {
my ($subj, $payload, $reply) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
t/01_connect.t view on Meta::CPAN
ok($connected, 'reset during connect: first connect succeeded');
$pg->finish if $pg && $pg->is_connected;
}
# connect() from inside on_error croaks: the failed conn is still installed
# while the handler runs. Timer-deferred connect (endpoint switching) works.
{
my ($croak, $switched);
my $pg;
$pg = EV::Pg->new(
conninfo => "$conninfo dbname=this_db_does_not_exist_xyz",
t/01_connect.t view on Meta::CPAN
my $t = EV::timer(10, 0, sub { EV::break });
EV::run;
$pg->finish if $pg && $pg->is_connected;
like($croak, qr/previous connection failed/,
'connect in on_error: actionable croak (not "already connected")');
ok($switched, 'connect in on_error: timer-deferred connect switches endpoints');
}
view all matches for this distribution
view release on metacpan or search on metacpan
deps/hiredis/README.md view on Meta::CPAN
}
}
```
One can also use `redisConnectWithOptions` which takes a `redisOptions` argument
that can be configured with endpoint information as well as many different flags
to change how the `redisContext` will be configured.
```c
redisOptions opt = {0};
/* One can set the endpoint with one of our helper macros */
if (tcp) {
REDIS_OPTIONS_SET_TCP(&opt, "localhost", 6379);
} else {
REDIS_OPTIONS_SET_UNIX(&opt, "/tmp/redis.sock");
}
deps/hiredis/README.md view on Meta::CPAN
/* Finally various options may be set via the `options` member, as described below */
opt->options |= REDIS_OPT_PREFER_IPV4;
```
If a connection is lost, `int redisReconnect(redisContext *c)` can be used to restore the connection using the same endpoint and options as the given context.
### Configurable redisOptions flags
There are several flags you may set in the `redisOptions` struct to change default behavior. You can specify the flags via the `redisOptions->options` member.
view all matches for this distribution
view release on metacpan or search on metacpan
t/27-review-coverage.t view on Meta::CPAN
is(scalar(@during), 0, "connections() excludes a still-connecting conn");
my $to = EV::timer(10, 0, sub { diag "Timeout!"; EV::break });
EV::run;
my @after = $ctx->connections; # client + server endpoints now open
ok(scalar(@after) >= 1, "connections() includes the established conn(s)");
$keep{cli}->close(1000) if $keep{cli};
}
# 10. send_fragment binary path: binary fragments reassemble into one binary
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Eixo/Docker/Container.pm view on Meta::CPAN
action=>'attach',
method=>'POST',
host=>$self->api->client->endpoint,
args=>\%args,
url_args=>[qw(logs stream stdin stdout stderr)],
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Eixo/Rest/Api.pm view on Meta::CPAN
sub DESTROY {}
sub initialize{
my ($self, $endpoint, %opts) = @_;
$self->client(
Eixo::Rest::Client->new($endpoint, %opts)
);
$self->SUPER::initialize(%opts);
$self;
view all matches for this distribution
view release on metacpan or search on metacpan
t/Elive/MockConnection.pm view on Meta::CPAN
my $self = {};
bless $self, $class;
$url ||= 'http://elive_mock_connection';
$url =~ s{/$}{}; # lose trailing '/'
$url =~ s{/webservice\.event$}{}; # lose endpoint
$url =~ s{/v[1-9]$}{}; # lose adapter path
if ($url =~ s{^(\w+)://(.*)\@}{$1://}) { # lose/capture credentials
my ($_user, $_pass) = split(':', $2, 2);
view all matches for this distribution