https://github.com/asyncphp/process
Simple abstraction for starting and stopping processes
https://github.com/asyncphp/process
async parallel process
Last synced: about 2 months ago
JSON representation
Simple abstraction for starting and stopping processes
- Host: GitHub
- URL: https://github.com/asyncphp/process
- Owner: asyncphp
- License: mit
- Created: 2017-01-08T20:08:17.000Z (about 9 years ago)
- Default Branch: main
- Last Pushed: 2020-06-18T16:25:36.000Z (over 5 years ago)
- Last Synced: 2024-11-25T09:32:41.771Z (over 1 year ago)
- Topics: async, parallel, process
- Language: PHP
- Homepage:
- Size: 6.84 KB
- Stars: 9
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.md
- Code of conduct: code-of-conduct.md
Awesome Lists containing this project
README
# Process
[](https://travis-ci.org/asyncphp/process)
[](https://scrutinizer-ci.com/g/asyncphp/process/?branch=master)
Simple abstraction for starting and stopping processes.
## Installation
```
composer require asyncphp/process
```
## Usage
```php
use AsyncPHP\Process\PosixHandler;
$loop->start($id = "server", $command = "start-server.sh", $background = true);
sleep(60);
$loop->stop($id);
```
## Compatibility
This library uses `exec` and `ps` to start and find processes. It will not work on systems where `exec` has been disabled, or where `ps -e/E` does not return the environment variables of a process. I've tested on macOS Sierra and Ubuntu Trusty `14.04`.
## Versioning
This library follows [Semver](http://semver.org). According to Semver, you will be able to upgrade to any minor or patch version of this library without any breaking changes to the public API. Semver also requires that we clearly define the public API for this library.
All methods, with `public` visibility, are part of the public API. All other methods are not part of the public API. Where possible, we'll try to keep `protected` methods backwards-compatible in minor/patch versions, but if you're overriding methods then please test your work before upgrading.