Download the PHP package kohkimakimoto/background-process without Composer
On this page you can find all versions of the php package kohkimakimoto/background-process. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kohkimakimoto/background-process
More information about kohkimakimoto/background-process
Files in kohkimakimoto/background-process
Package background-process
Short Description A minimum library to run background processes asynchronously.
License Apache License 2.0
Homepage https://github.com/kohkimakimoto/BackgroundProcess
Informations about the package background-process
BackgroundProcess
BackgroundProcess is a PHP Library to run background processes asynchronously on your system.
How it works
BackgroundProcess is simple. So it doesn't need any specific datastores such as RDBMS. And dosen't use somthing like a queue and daemon process.
When BackgroundProcess runs a process on the background, It creates two special files. One of them is an Executable PHP file. Another one is a JSON meta data file.
Executable PHP file is a PHP file executed by BackgroundProcess. It includes the command to run specified by you. It also has some initialization and finalization code. At default, this file name is like the following.
JSON meta data file is a json formmated file. it's created at the preprocess in the Executable PHP file. It includes process id and created timestamp. It is used to inspect background process statuses through BackgroundProcessManager Class API. At default, this file name is like the following
The executable PHP file and JSON meta data file have same name without extentions.
These two files are automatically deleted at the end of the processing. Therefore, you generally don't need to manipulate them.
Installation
User composer installation with below composer.json
.
And runs Composer install command.
Usage
The following code runs a command on the background.
The following code inspects the background process.
If your command raises error, BackgroundProcess writes logs to error log file.
Configuration Options
You can use configuration options to change behavior of BackgroundProcess.
License
Apache License 2.0