dev-master
9999999-devSimple queue mechanism for silex using beanstalkd
MIT
The Requires
by Ronan Chilvers
1.0
1.0.0.0Simple queue mechanism for silex using beanstalkd
MIT
The Requires
by Ronan Chilvers
Wallogit.com
2017 © Pedro Peláez
Simple queue mechanism for silex using beanstalkd
This is a simple queue mechanism for Silex using Beanstalkd as the backend., (*1)
Installation using composer:, (*2)
composer require ronanchilvers\silex-queue-beanstalkd
We're assuming that you have an accessible Beanstalkd instance running somewhere and that you know its network address., (*3)
To use the queue service you need to register the provider like so:, (*4)
$app->register(new Ronanchilvers\Silex\Queue\QueueProvider());
By default this assumes that Beanstalkd is running on the default port (11300) on localhost., (*5)
There are a few configuration directives that you can use to get the queue service working. You can pass these in using the normal Silex way like this:, (*6)
$app->register(new Ronanchilvers\Silex\Queue\QueueProvider(), [
'queue.options' => [
'host' => '1.2.3.4'
]
]);
The available configuration keys are:, (*7)
max.iterations : maximum iterations a worker does when using the queue:consume CLI command before exiting, (*8)
A simple consume command for use with symfony/console is provided. The command requires the knplabs/console-service-provider package as it needs access to the Application object. To use it you can do something like this:, (*9)
$console->add(new Ronanchilvers\Silex\Queue\Console\Command\ConsumeCommand());
which will add a queue:consume command to the console application., (*10)
Simple queue mechanism for silex using beanstalkd
MIT
Simple queue mechanism for silex using beanstalkd
MIT