Etcd3
view release on metacpan or search on metacpan
# return single key value or the first in a list.
$key->get_value
# get range of keys
$range = $etcd->range({ key =>'test0', range_end => 'test100' });
# return array { key => value } pairs from range request.
my @users = $range->all
# watch key range, streaming.
$watch = $etcd->watch( { key => 'foo', range_end => 'fop'}, sub {
my ($result) = @_;
print STDERR Dumper($result);
})->create;
# create/grant 20 second lease
$etcd->lease( { ID => 7587821338341002662, TTL => 20 } )->grant;
# attach lease to put
$etcd->put( { key => 'foo2', value => 'bar2', lease => 7587821338341002662 } );
# return single key value or the first in a list.
$key->get_value
# get range of keys
$range = $etcd->range({ key =>'test0', range_end => 'test100' });
# return array { key => value } pairs from range request.
my @users = $range->all
# watch key range, streaming.
$watch = $etcd->watch( { key => 'foo', range_end => 'fop'}, sub {
my ($result) = @_;
print STDERR Dumper($result);
})->create;
# create/grant 20 second lease
$etcd->lease( { ID => 7587821338341002662, TTL => 20 } )->grant;
# attach lease to put
$etcd->put( { key => 'foo2', value => 'bar2', lease => 7587821338341002662 } );
lib/Etcd3.pm view on Meta::CPAN
# return single key value or the first in a list.
$key->get_value
# get range of keys
$range = $etcd->range({ key =>'test0', range_end => 'test100' });
# return array { key => value } pairs from range request.
my @users = $range->all
# watch key range, streaming.
$watch = $etcd->watch( { key => 'foo', range_end => 'fop'}, sub {
my ($result) = @_;
print STDERR Dumper($result);
})->create;
# create/grant 20 second lease
$etcd->lease( { ID => 7587821338341002662, TTL => 20 } )->grant;
# attach lease to put
$etcd->put( { key => 'foo2', value => 'bar2', lease => 7587821338341002662 } );
lib/Etcd3/Lease.pm view on Meta::CPAN
$self->{endpoint} = '/kv/lease/timetolive';
confess 'ID is required for ' . __PACKAGE__ . '->ttl'
unless $self->{ID};
$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};
lib/Etcd3/Watch.pm view on Meta::CPAN
Etcd3::Range
=cut
our $VERSION = '0.007';
=head1 DESCRIPTION
Watch watches for events happening or that have happened. Both input and output are streams;
the input stream is for creating and canceling watchers and the output stream sends events.
One watch RPC can watch on multiple key ranges, streaming events for several watches at once.
The entire event history can be watched starting from the last compaction revision.
=head1 ACCESSORS
=head2 endpoint
=cut
has endpoint => (
is => 'ro',
( run in 0.258 second using v1.01-cache-2.11-cpan-4d50c553e7e )