https://github.com/basilfx/phalcon-jobqueue
PHP job queue for asynchronous tasks within the Phalcon Framework.
https://github.com/basilfx/phalcon-jobqueue
Last synced: 9 months ago
JSON representation
PHP job queue for asynchronous tasks within the Phalcon Framework.
- Host: GitHub
- URL: https://github.com/basilfx/phalcon-jobqueue
- Owner: basilfx
- License: mit
- Created: 2017-03-13T07:59:29.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-13T10:01:13.000Z (over 9 years ago)
- Last Synced: 2025-03-03T14:47:54.371Z (over 1 year ago)
- Language: PHP
- Size: 7.81 KB
- Stars: 0
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Phalcon-JobQueue
PHP job queue for asynchronous tasks within the Phalcon Framework.
## Introduction
Phalcon has support for [Beanstalkd](http://kr.github.io/beanstalkd/), but it requires an broker to run jobs.
This is a different implementation that runs within the same environment. It has support for synchronous mode.
To add a job:
```php
$this->jobQueue->add(new Job("sayHello", [
"name" => "World"
]));
```
Below is an example of an executor service:
```php
getAction();
$parameters = $job->getParameters();
if ($action === "sayHello") {
echo "Hello, {$parameters["name"]}!";
$job->setResult("Done.");
$job->setProgress(100);
$update($job);
}
}
}
```
## Requirements
* PHP 7.0 or later.
* Phalcon Framework 3.0 or later.
## Installation
Install this dependency using `composer require basilfx/phalcon-jobqueue`.
## License
See the `LICENSE` file (MIT license).