https://github.com/autoframe/process-control
https://github.com/autoframe/process-control
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/autoframe/process-control
- Owner: autoframe
- License: mit
- Created: 2023-09-21T20:35:07.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-04T10:44:54.000Z (over 2 years ago)
- Last Synced: 2025-10-25T00:32:39.364Z (8 months ago)
- Language: PHP
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Autoframe is a low level framework that is oriented on SOLID flexibility
[](https://github.com/autoframe/process-control/actions?query=branch:main)
[](https://opensource.org/license/bsd-3-clause/)

[](https://packagist.org/packages/autoframe/process-control)
*PHP worker instance create and inter process lock check Autoframe Framework*
```php
/** Concrete implementation that uses the php temporary folder to store the lock */
namespace Autoframe\Process\Control\Lock;
class AfrLockFileClass implements AfrLockInterface
...
interface AfrLockInterface
{
/** Check if the lock is in place */
public function isLocked(): bool;
/** Creates a new lock or fails */
public function obtainLock(): bool;
/** Returns false if lock is in place and the lock file can't be closed
* Returns true if there is no lock in place or operation was successfully made */
public function releaseLock(): bool;
/** Returns Process ID for the lock thread or zero if other case */
public function getLockPid(): int;
}
```
---
```php
/** Concrete implementation for create (spawn) worker process in background */
namespace Autoframe\Process\Control\Worker\Background;
class AfrBackgroundWorkerClass implements AfrBackgroundWorkerInterface
...
interface AfrBackgroundWorkerInterface
{
/** Returns /usr/bin/php or C:\xampp\php\php.exe or php */
public static function getPhpBin(): string;
/** Calls: php $execFileArgs > /dev/null & or widows equivalent start /B */
public static function execWithArgs(string $execFileArgs): void;
}
```