An open API service indexing awesome lists of open source software.

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.

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).