laravel-websockets/src/Queue/AsyncRedisConnector.php

25 lines
580 B
PHP
Raw Normal View History

2020-09-25 19:16:06 +00:00
<?php
namespace BeyondCode\LaravelWebSockets\Queue;
use Illuminate\Queue\Connectors\RedisConnector;
class AsyncRedisConnector extends RedisConnector
{
/**
* Establish a queue connection.
*
* @param array $config
* @return \Illuminate\Contracts\Queue\Queue
*/
public function connect(array $config)
{
return new AsyncRedisQueue(
$this->redis, $config['queue'],
$config['connection'] ?? $this->connection,
$config['retry_after'] ?? 60,
$config['block_for'] ?? null
);
}
}