The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

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)