Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Yii2 Queue Laravel Package

yiisoft/yii2-queue

Yii2 Queue runs tasks asynchronously via pluggable queue backends: DB, Redis, RabbitMQ/AMQP, Beanstalk, ActiveMQ, and Gearman. Define jobs as classes implementing JobInterface and push them to the queue for background processing.

View on GitHub
Deep Wiki
Context7

Beanstalk ドライバ

このドライバは Beanstalk のキューによって動作します。

構成例:

return [
    'bootstrap' => [
        'queue', // コンポーネントが自身のコンソール・コマンドを登録します
    ],
    'components' => [
        'queue' => [
            'class' => \yii\queue\beanstalk\Queue::class,
            'host' => 'localhost',
            'port' => 11300,
            'tube' => 'queue',
        ],
    ],
];

コンソール

キューに入れられたジョブの実行と管理のためにコンソール・コマンドが使用されます。

yii queue/listen [timeout]

listen コマンドは無限にキューを調べ続けるデーモンを起動します。キューに新しいタスクがあると、即座に取得され、実行されます。 timeout パラメータはキューを調べる間のスリープの秒数を指定するものです。 このコマンドを supervisor または systemd によって適切にデーモン化するのが、 最も効率的な方法です。

yii queue/run

run コマンドは、キューが空になるまでループして、タスクを取得し、実行します。 cron に向いた方法です。

run および listen のコマンドは下記のオプションを持っています。

  • --verbose, -v: 実行の状態をコンソールに表示します。
  • --isolate: すべてのタスクが独立した子プロセスで実行されます。
  • --color: 饒舌モードでハイライトを有効にします。
yii queue/info

info コマンドはキューの状態について情報を表示します。

yii queue/remove [id]

remove コマンドはキューからジョブを削除します。

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log