Daisuke Maki > Data-Valve-0.00005 > Data::Valve::BucketStore::WithKeyedMutex

Download:
Data-Valve-0.00005.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Source   Latest Release: Data-Valve-0.00008

NAME ^

Data::Valve::BucketStore::WithKeyedMutex - Role To Add Locking Via KeyedMutex

SYNOPSIS ^

  package MyBucketStore;
  use Moose;

  with 'Data::Valve::BucketStore';
  with 'Data::Valve::BucketStore::WithKeyedMutex';

  no Moose;

METHODS ^

lock

Attempts to acquire a lock. Returns KeyedMutex::Lock on success.

If no KeyedMutex object is available (or KeyedMutex object errors out because of, e.g., the server is unreacheable, etc.), returns 1. This basically means that your bucket store will run in degraded mode.

On lock failures, returns whatever KeyedMutex->lock returns (false)