Download the PHP package treehouselabs/worker-bundle without Composer
On this page you can find all versions of the php package treehouselabs/worker-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download treehouselabs/worker-bundle
More information about treehouselabs/worker-bundle
Files in treehouselabs/worker-bundle
Package worker-bundle
Short Description Adds worker functionality to a Symfony2 project, using Beanstalkd as the message queue
License MIT
Informations about the package worker-bundle
Deprecated & archived
This bundle is no longer maintained. It will still work with Symfony versions ^2.8|^3.0|^4.0
and is archived here to not break existing applications using it. However it will not get maintenance updates or even security fixes.
If you need queue/worker functionality in your project, there are far better solutions right now to look at:
Previous readme below 👇
Worker bundle
A Symfony bundle that adds worker functionality to your project, using Beanstalkd as the message queue.
Installation
For this process, we assume you have a Beanstalk server up and running.
Install via Composer:
Enable the bundle:
Configuration
Define a queue and you're good to go:
The bundle also supports the PheanstalkBundle, if you're using that:
Basic Usage
The bundle creates a QueueManager
service, which you can use to manage
jobs. The manager has services registered to execute specific tasks, called
executors. An executor receives a job from the QueueManager and processes it.
Defining executors
First you need to register an executor, and tag it as such:
Scheduling jobs
Now you can add jobs, either via code or using the worker:schedule
command:
In your application's code:
Using the command:
Working jobs
A worker can now receive and process these jobs via the console:
You can run workers by adding them to your crontab, creating a Supervisor program for it, or whatever your preferred method is.
Documentation
- Message queues & workers
- The QueueManager
- Executors
- Working jobs
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
License
The MIT License (MIT). Please see License File for more information.
Credits
- Peter Kruithof
- All Contributors