fk / queue
PHP based queue execution program
Installs: 31
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/fk/queue
Requires
- php: >=7.0
- fk/daemon: *
- fk/helpers: *
- pda/pheanstalk: *
This package is not auto-updated.
Last update: 2025-09-28 01:12:04 UTC
README
Extension can work as yii extension too
- register as a component
# main.php return [ 'components' => [ 'queue' => [ 'class' => 'fk\queue\wrapper\yii2\Connection', 'logPath' => '@console/runtime/logs/queue.log', 'engine' => 'fk\queue\engines\Redis', ] ] ]
- queue in
Yii::$app->queue->in('ls -l'); // bash> ls -l Yii::$app->queue->in(new YiiCommand(['migrate'])); // bash> php yii migrate
You can write your own XXCommand
to parse a command, but in the end, a bash command should be returned
If the argument for in
is empty, then the cmd will be ignored
- map of console
# console\config\main.php return [ 'controllerMap' => [ 'queue' => [ 'class' => 'fk\queue\wrapper\yii2\QueueController' ] ], ]
- queue start
php yii queue/start
Command
Writing your own command by extends \fk\queue\commands\Command
and overwrite method CommandInterface::parse
<?php class MyCommand extends \fk\queue\commands\Command { public $command; public function parse() { // Parse your command with its property `command` } }