Download the PHP package wowo/wowo-queue-bundle without Composer
On this page you can find all versions of the php package wowo/wowo-queue-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wowo/wowo-queue-bundle
More information about wowo/wowo-queue-bundle
Files in wowo/wowo-queue-bundle
Package wowo-queue-bundle
Short Description The WowoQueueBundle provides unified method for use queue systems, like Beanstalkd, RabbitMQ, flat files, database driven queues etc.
License MIT
Informations about the package wowo-queue-bundle
WowoQueueBundle
The WowoQueueBundle provides unified method for use queue systems, like Beanstalkd, RabbitMQ, flat files, database driven queues, etc. For now it only supports Beanstalkd, but you can add your own implementation on your own and send pull request.
Installation
Step 1: Download WowoQueueBundle
If you are using Deps (Symfony 2.0.x)
Add following lines to your deps
file:
Now, run the vendors script to download the bundle:
If you are using Composer (Symfony >= 2.1.x)
Add following lines to your composer.json
requirements:
Now, install the bundle with composer:
Step 2: Configure the Autoloader
(You can jump to Step 3 if you are using composer)
Add the Wowo
namespace to your autoloader:
Also add Pheanstalk init on the bottom of autoload:
Step 3: Enable the bundle
Finally, enable the bundle in the kernel:
Step 4: install and run beanstalkd
On Debian linux systems (including Ubuntu) you can run:
Then run it as a daemon:
Note: If your beanstalkd service is running in other address or port, you must set the following parameter in your configuration:
Don't forget to change with your address and port.
Usage
Using Beanstalkd in-memory queueing server
Obtain manager with Beanstalkd implementation from the controller
Put some job into the queue to default tube wowo_queue. which can be changed by wowo_queue.pheanstalk.tube parameter
Get jobs as soon as they appear in queue. In below example an infinite loop is presented. Such operations should be run as a background tasks, which listens to the queue and processes jobs when they appear.
Deleting jobs from the queue is fairly easy
Using Beanstalkd implementation without service container
Manager object creation is simple and can be done as listed below. This is useful when you don't use bundle in Symfony project.
In case you are not using autoloader, Pheanstalk need to be autoloaded by hand:
Amazon SQS
The SQSQueueImplementation utilizes the AWS PHP SDK v2
Configuration
To inject the SQS Implementation into your QueueManager, make sure you instantiate it with a configured SQS client and an associative array mapping tube names to SQS queue names.
Symfony bundle's services.yml example
From there, you can simply inject the SQS implementation into your QueueManager to get or put messages