EV-Etcd
view release on metacpan or search on metacpan
lib/EV/Etcd.pm view on Meta::CPAN
application-level retry logic.
=head1 CALLBACK LIFETIMES
Callbacks are stored in C structures that are invisible to Perl's garbage
collector. A callback closure that captures the client (or its own stream
handle) forms a reference cycle that Perl cannot reclaim: the objects stay
alive until the stream is cancelled or the client is destroyed, even if all
Perl-side references are dropped.
For long-lived streams, capture a weakened client reference and call
C<cancel()> when the stream is no longer needed:
use Scalar::Util 'weaken';
my $client = EV::Etcd->new(endpoints => ['127.0.0.1:2379']);
weaken(my $weak = $client);
my $watch = $client->watch('/my/key', sub {
my ($resp, $err) = @_;
return if $err;
$weak->put('/my/seen', 1, sub {}) if $weak;
});
# ... later:
$watch->cancel(sub { });
=head1 KEY-VALUE OPERATIONS
sv_resetpvn|5.017005||Viu
SvRMAGICAL|5.003007||Viu
SvRMAGICAL_off|5.003007||Viu
SvRMAGICAL_on|5.003007||Viu
SvROK|5.003007|5.003007|
SvROK_off|5.003007|5.003007|
SvROK_on|5.003007|5.003007|
SvRV|5.003007|5.003007|
SvRV_const|5.010001||Viu
SvRV_set|5.009003|5.003007|p
sv_rvunweaken|5.027004|5.027004|
sv_rvweaken|5.006000|5.006000|
SvRVx|5.003007||Viu
SvRX|5.009005|5.003007|p
SvRXOK|5.009005|5.003007|p
SV_SAVED_COPY|5.009005||Viu
SvSCREAM|5.003007||Viu
SvSCREAM_off|5.003007||Viu
SvSCREAM_on|5.003007||Viu
sv_setbool|5.035004|5.035004|
sv_setbool_mg|5.035004|5.035004|
sv_setgid|5.019001||Viu
( run in 2.050 seconds using v1.01-cache-2.11-cpan-0fb53d1c279 )