Download the PHP package sadovnik/beanstalk-yii2 without Composer
On this page you can find all versions of the php package sadovnik/beanstalk-yii2. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package beanstalk-yii2
This is a temporary fork of https://github.com/sergebezborodov/beanstalk-yii2
Beanstalk Worker App for Yii2
What is it?
Queries is important part for any big project. I used Gearman for years in my past projects and when I started develop hotwork.ru I read a lot of articles about different query system. Finnaly I chosed beanstalk - It was inspired by memcache protocol, it's simple, fast and stable. Beanstalk works at my server more than three month without restarting. For rabbitmq it will be unbelievable.
How to install
Install it by composer, add to composer.json
How to configure
For work with any query system you must create worker application. It must work permanently (at screen or supervisor) and listeting beastalk server. Client application set task to server and server call worker application for execution.
Create worker file, same as console:
Worker config example:
It's very important to close connection to database after worker completes task. Add all db connection to 'on beforeAction'
and 'on afterAction'
events.
How to use
You must start worker with argument of tube name, for example:
./worker import
- it will handle only tasks from import tube.
./worker
- it will handle all tasks from all available tubes.
Handling terminate signals
Terminate some tasks at execution will cause big problems, as solution app handle SIGINT signal (Ctrl+C) and wait for end of active task. You can disable with behavior by setting handleSignals
property to false. PHP must be compiled with pcntl
.
All versions of beanstalk-yii2 with dependencies
yiisoft/yii2 Version *
yiisoft/yii2-composer Version *
davidpersson/beanstalk Version *