IPC-SRLock

 view release on metacpan or  search on metacpan

lib/IPC/SRLock.pm  view on Meta::CPAN

};

# Public attributes
has 'type' => is => 'ro', isa => NonEmptySimpleStr, default => 'fcntl';

# Private attributes
has '_implementation'       => is => 'lazy', isa => Object,
   handles                  => [ qw( get_table list reset set ) ],
   builder                  => $_build__implementation;

has '_implementation_attr'  => is => 'ro',   isa => HashRef, required => 1;

has '_implementation_class' => is => 'lazy', isa => LoadableClass,
   builder                  => $_build__implementation_class;

# Construction
around 'BUILDARGS' => sub {
   my ($orig, $self, @args) = @_; my $attr = $orig->( $self, @args );

   my $builder = $attr->{builder};
   my $conf    = $builder && $builder->can( 'config' ) ? $builder->config : 0;

lib/IPC/SRLock/Memcached.pm  view on Meta::CPAN

use English                qw( -no_match_vars );
use File::DataClass::Types qw( ArrayRef NonEmptySimpleStr Object );
use IPC::SRLock::Utils     qw( Unspecified hash_from loop_until throw );
use Moo;

extends q(IPC::SRLock::Base);

# Public attributes
has 'lockfile' => is => 'ro', isa => NonEmptySimpleStr, default => '_lockfile';

has 'servers'  => is => 'ro', isa => ArrayRef,
   default     => sub { [ 'localhost:11211' ] };

has 'shmfile'  => is => 'ro', isa => NonEmptySimpleStr, default => '_shmfile';

# Private attributes
has '_memd'    => is => 'lazy', isa => Object, reader => 'memd',
   builder     => sub { Cache::Memcached->new
                           ( debug     => $_[ 0 ]->debug,
                             namespace => $_[ 0 ]->name,
                             servers   => $_[ 0 ]->servers ) };



( run in 0.667 second using v1.01-cache-2.11-cpan-5f2e87ce722 )