2017 © Pedro Peláez
 

library redis-mutex

A simple Redis-backed mutex lock.

image

cognizo/redis-mutex

A simple Redis-backed mutex lock.

  • Monday, October 14, 2013
  • by gfloyd
  • Repository
  • 6 Watchers
  • 5 Stars
  • 21,658 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 3 % Grown

The README.md

RedisMutex

RedisMutex is a simple Redis-backed distributed mutex for PHP., (*1)

Basic Usage

<?php

use Cognizo\RedisMutex\Lock;

if (Lock::get('myLock'))
{
    // Do something exclusively

    Lock::release('myLock');
}
else
{
    echo "Couldn't get exclusive lock!";
}

You can also wait for a lock to be released:, (*2)

// Wait up to 30 seconds for 'myLock' to become available
Lock::get('myLock', 30);

Specifying the Redis connection:, (*3)

define('REDIS_PATH', 'tcp://127.0.0.1:6379');

// Or

define('REDIS_HOST', '127.0.0.1');
define('REDIS_PORT', 6379);

Install

Install the cognizo/redis-mutex package with Composer., (*4)

The Versions

14/10 2013

dev-master

9999999-dev https://github.com/cognizo/redis-mutex

A simple Redis-backed mutex lock.

  Sources   Download

MIT

The Requires

 

by Graham Floyd

14/10 2013

v0.0.2

0.0.2.0 https://github.com/cognizo/redis-mutex

A simple Redis-backed mutex lock.

  Sources   Download

MIT

The Requires

 

by Graham Floyd

19/06 2013

v0.0.1

0.0.1.0 https://github.com/cognizo/redis-mutex

A simple Redis-backed mutex lock.

  Sources   Download

MIT

The Requires

 

by Graham Floyd