AnyEvent-Retry
view release on metacpan or search on metacpan
lib/AnyEvent/Retry.pm view on Meta::CPAN
}
# start the user's code running, with a continuation-passing-style
# callback to call when the result is ready
sub run_code {
my ($self) = @_;
# we weaken $self here so that if the user does "undef $retry", we
# DEMOLISH the object and silently discard the results of the
# running code. feel free to subclass if want to keep the class
# alive arbitrarily.
weaken $self;
my $success = sub {
my $result = shift;
return unless defined $self;
$self->handle_result(($result ? 1 : 0), 'success', $result);
return;
};
my $error = sub {
( run in 1.003 second using v1.01-cache-2.11-cpan-df04353d9ac )