liip/LiipProcessManager

Name: LiipProcessManager

Owner: Liip

Description: Provides a simple locking mechanism based on UNIX process id's written to a "PID file".

Created: 2011-11-10 17:09:16.0

Updated: 2017-02-11 16:34:36.0

Pushed: 2014-07-30 07:42:32.0

Homepage: http://liip.ch

Size: 193

Language: PHP

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

ProcessManager

Provides a simple locking mechanism based on UNIX process id's written to a “PID file”.

Build Status

http://github.com/liip/LiipProcessManager.git

Here is a simple example

p
Liip\ProcessManager\ProcessManager;
Liip\ProcessManager\PidFile;

un a process in the back ground
cessManager = new ProcessManager();
 = $processManager->execProcess('sleep 10m');
cessManager->isProcessRunning($pid)
cessManager->killProcess($pid);

o set log location instead of routing it to /dev/null by default
cessManager = new ProcessManager('/path/to/logfile');
 = $processManager->execProcess('sleep 10m');

cquire a lock via a pid file
k = new PidFile(new ProcessManager(), '/tmp/foobar');
k->acquireLock();
 = $lock->execProcess('sleep 10m');
et the PID which should be locked on
k->setPid(getmypid());
k->releaseLock();

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.