2017 © Pedro Peláez
 

library semaphore

Don't let your app be afraid of parallel execution

image

boo1ean/semaphore

Don't let your app be afraid of parallel execution

  • Wednesday, December 11, 2013
  • by boo1ean
  • Repository
  • 1 Watchers
  • 1 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Keep your thread locked!

This package provide simple semaphore wrapper which can work different adapters, (*1)

Basic usage

<?php

use Semaphore\Semaphore;

$lock = new Semaphore();
$key  = 'oh no!';

if ($lock->locked($key) {
    // Meh, it's so locked...
} else {
    // Lock semaphore
    $lock->lock($key);

    // Do thread-safe operations
    reallyImportantCriticalStuff();

    // Release lock
    $lock->unlock($key);
}

The Versions

11/12 2013

dev-master

9999999-dev

Don't let your app be afraid of parallel execution

  Sources   Download

MIT

The Requires

 

by Egor Gumenyuk

parallel semaphore good choice