我只是想运行一个事件和监听器循环并将一个模型传递给它
event(new LabelsCreated($model, 'string'));
这与 完美配合,QUEUE_CONNECTION=database
但QUEUE_CONNECTION=redis
它会给我一个错误:
#message:“数组到字符串的转换”
#代码:0
#file:“/home/vagrant/Code/Upworks/myproj/vendor/laravel/framework/src/Illuminate/Queue/RedisQueue.php”
#线:302
#严重性:E_NOTICE
我的事件类如下所示:
class LabelsCreated
{
use Dispatchable, SerializesModels;
public $model;
public $string;
public function __construct($model, $string)
{
$this->model = $model;
$this->string = $string;
// comes here
}
}
但它根本没有让我的听众排队。
我的 config/queue.php,redis 数组如下所示:
'redis' => [
'driver' => 'redis',
'connection' => 'default',
'queue' => ['default', 'export'],
'retry_after' => 90,
'block_for' => null,
],
它可能指的是关键的“队列”值吗?