AnyEvent-Retry
view release on metacpan or search on metacpan
lib/AnyEvent/Retry/Coro.pm view on Meta::CPAN
package AnyEvent::Retry::Coro;
BEGIN {
$AnyEvent::Retry::Coro::VERSION = '0.03';
}
# ABSTRACT: AnyEvent::Retry for jobs that run in separate threads
use Moose;
use Coro;
use Scalar::Util qw(weaken);
use Try::Tiny;
use true;
use namespace::autoclean;
extends 'AnyEvent::Retry';
lib/AnyEvent/Retry/Coro.pm view on Meta::CPAN
}
__PACKAGE__->meta->make_immutable;
=pod
=head1 NAME
AnyEvent::Retry::Coro - AnyEvent::Retry for jobs that run in separate threads
=head1 VERSION
version 0.03
=head1 SYNOPSIS
use Coro;
my $r = AnyEvent::Retry::Coro->new(
lib/AnyEvent/Retry/Coro.pm view on Meta::CPAN
=head1 DESCRIPTION
This module makes L<AnyEvent::Retry> work nicely with L<Coro>. You
don't need to provide success or failure callbacks anymore, and your
task to retry just needs C<die> or return a result.
=head1 METHODS
=head2 run
This runs the task, blocking the thread until a result is available.
If your task encounters an error, this will die. If it's sucessful,
it returns the result.
=head2 wait
Allows you to run the task without blocking:
$r->start;
...; # do anything
my $result = $r->wait; # block here
( run in 0.509 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )