Mon*_*Ove 5 laravel laravel-5.1
我有这个 Laravel 5.1 事件,在存储聊天时触发。但它正在为 Pusher 创建多个广播
<?php namespace App\Events;
use App\Events\Event;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Queue\SerializesModels;
class ChatSent extends Event implements ShouldBroadcast
{
use SerializesModels;
public $channel;
public $chat;
public function __construct($channel,$chat)
{
$this->channel = $channel;
$this->chat = $chat;
}
public function broadcastOn()
{
return ['private-'.$this->channel];
}
}
Run Code Online (Sandbox Code Playgroud)
我正在与多名工人一起使用主管(supervisord)......不确定这是否有所不同......这是laravel.conf:
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/app/artisan queue:work database --sleep=3 --tries=3 --daemon
autostart=true
autorestart=true
user=ubuntu
numprocs=8
redirect_stderr=true
stdout_logfile=/var/www/app/worker.log
Run Code Online (Sandbox Code Playgroud)
知道为什么会发生这种情况吗?
| 归档时间: |
|
| 查看次数: |
612 次 |
| 最近记录: |