Download the PHP package vanilla/garden-message-queue without Composer
On this page you can find all versions of the php package vanilla/garden-message-queue. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vanilla/garden-message-queue
More information about vanilla/garden-message-queue
Files in vanilla/garden-message-queue
Package garden-message-queue
Short Description A message queue implementation for Vanilla.
License MIT
Informations about the package garden-message-queue
Garden Message Queue
This component provides everything needed for Vanilla to schedule jobs and process them.
It provides two main services, a JobQueue
and a JobDriver
. The JobQueue
provides a scheduling service while the JobDriver
provides an implementation which executes job payloads on the web server itself.
How to set it up in Vanilla?
- Add
vanilla/garden-message-queue
to therequire
section in Vanilla'scomposer.json
. - Run
composer update
- Bootstrap this component by adding the following snippet in Vanilla's
bootstrap.php
.
Once configured, you can access the scheduler to add a job as followed:
At the end of the web request, once GDN_Dispatcher
is done rendering the view, all jobs scheduled with the JobQueue
will be processed one after another. A call to fastcgi_finish_request() will be made so that all processing can run in the background without hanging the browser rendering.
How to execute jobs on a dedicated queue system?
You can provide your own driver by implementing the JobDriverInterface
interface and then configure the container to use that custom job driver instead of the default one.
This new driver would then be responsible to delegate jobs to an external queue system such as RabbitMQ. A new job processor would have to be implemented in order to consume those jobs. Take a look at the Queue Interop repo for hints as to what the implementation would entail.
All versions of garden-message-queue with dependencies
psr/log Version ^1.0
vanilla/queue-interop Version dev-master
vanilla/garden-db Version ^0.1.0
vanilla/garden-container Version >=1.3.4