🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
## 事件监听者指定队列名称 ``` namespace App\Listeners; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Contracts\Queue\ShouldQueue; class ProcessTask implements ShouldQueue { use InteractsWithQueue; /** * 任务将被发送到的队列的名称 * * @var string|null */ public $queue = 'cate_rule_match'; } ``` ## 队列指定队列名称 ``` namespace App\Jobs; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Foundation\Bus\Dispatchable; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\SerializesModels; class ProcessTask implements ShouldQueue { use Dispatchable, InteractsWithQueue, SerializesModels; /** * Create a new job instance. * * @return void */ public function __construct() { $this->onQueue('queue_name'); } } ``` 或者 ~~~ ProcessTask::dispatch()->onQueue('queue_name'); ~~~