library process-manager
Provides a simple locking mechanism based on UNIX process id's written to a PID file.
liip/process-manager
Provides a simple locking mechanism based on UNIX process id's written to a PID file.
- Wednesday, July 30, 2014
- by lsmith
- Repository
- 43 Watchers
- 34 Stars
- 33,695 Installations
- PHP
- 8 Dependents
- 0 Suggesters
- 5 Forks
- 1 Open issues
- 5 Versions
- 4 % Grown
ProcessManager
Provides a simple locking mechanism based on UNIX process id's written to a "PID file"., (*1)
, (*2)
http://github.com/liip/LiipProcessManager.git, (*3)
Here is a simple example, (*4)
<?php
use Liip\ProcessManager\ProcessManager;
use Liip\ProcessManager\PidFile;
// run a process in the back ground
$processManager = new ProcessManager();
$pid = $processManager->execProcess('sleep 10m');
$processManager->isProcessRunning($pid)
$processManager->killProcess($pid);
// to set log location instead of routing it to /dev/null by default
$processManager = new ProcessManager('/path/to/logfile');
$pid = $processManager->execProcess('sleep 10m');
// acquire a lock via a pid file
$lock = new PidFile(new ProcessManager(), '/tmp/foobar');
$lock->acquireLock();
$pid = $lock->execProcess('sleep 10m');
// set the PID which should be locked on
$lock->setPid(getmypid());
$lock->releaseLock();
dev-master
9999999-dev
Provides a simple locking mechanism based on UNIX process id's written to a PID file.
Sources
Download
MIT
The Requires
locking
pid
unix
1.0.3
1.0.3.0
Provides a simple locking mechanism based on UNIX process id's written to a PID file.
Sources
Download
MIT
The Requires
locking
pid
unix
1.0.2
1.0.2.0
Provides a simple locking mechanism based on UNIX process id's written to a PID file.
Sources
Download
MIT
The Requires
locking
pid
unix
1.0.1
1.0.1.0
Provides a simple locking mechanism based on UNIX process id's written to a PID file.
Sources
Download
MIT
The Requires
locking
pid
unix
1.0.0
1.0.0.0
Provides a simple locking mechanism based on UNIX process id's written to a PID file.
Sources
Download
MIT
The Requires
locking
pid
unix