2017 © Pedro Peláez
 

library flock

Simple locking mechanism on top of flock()

image

f3ath/flock

Simple locking mechanism on top of flock()

  • Wednesday, October 4, 2017
  • by f3ath
  • Repository
  • 0 Watchers
  • 1 Stars
  • 130 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

Travis Build, (*1)

Flock. Simple locking mechanism on top of flock()

Usage

$file = '/tmp/my_lock.pid';
$lock = new F3\Flock\Lock($file);

// Non-blocking case. Acquire lock if it's free, otherwse exit immediately
if ($lock->acquire()) {
    // only one instance can reach here
    ...
    // do some job
    ...
    $lock->release();
} else {
    die('Another process is running')
}


// Waiting case. Acquire lock if it's free, otherwse block until it's free and then acquire
if ($lock->acquire(F3\Flock\Lock::BLOCKING)) {
    // only one instance can reach here
    ...
    // do some job
    ...
    $lock->release();
} else {
    // We sould not get to this point in this case
}

The Versions

04/10 2017

dev-f3ath-patch-1

dev-f3ath-patch-1 https://github.com/f3ath/Flock

Simple locking mechanism on top of flock()

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

by Alexey Karapetov

cron lock locking flock

04/10 2017

dev-master

9999999-dev https://github.com/f3ath/Flock

Simple locking mechanism on top of flock()

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

by Alexey Karapetov

cron lock locking flock

04/10 2017

1.0.1

1.0.1.0 https://github.com/f3ath/Flock

Simple locking mechanism on top of flock()

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

by Alexey Karapetov

cron lock locking flock

09/01 2017

1.0.0

1.0.0.0 https://github.com/f3ath/Flock

Simple locking mechanism on top of flock(). Ideal for cron jobs.

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

by Alexey Karapetov

cron lock locking flock

09/01 2017

1.0.0-alpha1

1.0.0.0-alpha1 https://github.com/f3ath/Flock

Simple locking mechanism on top of flock(). Ideal for cron jobs.

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

by Alexey Karapetov

cron lock locking flock

09/01 2017

1.0.0-alpha0

1.0.0.0-alpha https://github.com/f3ath/Flock

Simple locking mechanism on top of flock(). Ideal for cron jobs.

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

by Alexey Karapetov

cron lock locking flock

12/03 2014

0.0.3

0.0.3.0 https://github.com/f3ath/Flock

Simple locking mechanism on top of flock(). Ideal for cron jobs.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by Alexey Karapetov

cron lock locking flock

12/03 2014

0.0.2

0.0.2.0 https://github.com/f3ath/Flock

Simple locking mechanism on top of flock()

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • f3ath/debug 0.*

 

The Development Requires

by Alexey Karapetov

lock locking flock

25/02 2014

0.0.1

0.0.1.0 https://github.com/f3ath/Flock

Simple locking mechanism on top of flock()

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • f3ath/debug 0.*

 

The Development Requires

by Alexey Karapetov

lock locking flock