Action-CircuitBreaker
view release on metacpan or search on metacpan
lib/Action/CircuitBreaker.pm view on Meta::CPAN
package Action::CircuitBreaker;
$Action::CircuitBreaker::VERSION = '0.1';
# ABSTRACT: Module to try to perform an action, with an option to suspend execution after a number of failures.
use Scalar::Util qw(blessed);
use Time::HiRes qw(gettimeofday);
use Carp;
use base 'Exporter';
our @EXPORT = ((caller())[1] eq '-e' ? @EXPORT_OK : ());
use Moo;
has error_if_code => (
is => 'ro',
required => 1,
isa => sub { ref $_[0] eq 'CODE' },
default => sub { sub { $_[0] }; },
( run in 1.285 second using v1.01-cache-2.11-cpan-b61123c0432 )