AsyncRedisConnector::connect()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 7
rs 10
1
<?php
2
3
namespace BeyondCode\LaravelWebSockets\Queue;
4
5
use Illuminate\Queue\Connectors\RedisConnector;
6
7
class AsyncRedisConnector extends RedisConnector
8
{
9
    /**
10
     * Establish a queue connection.
11
     *
12
     * @param  array  $config
13
     * @return \Illuminate\Contracts\Queue\Queue
14
     */
15
    public function connect(array $config)
16
    {
17
        return new AsyncRedisQueue(
18
            $this->redis, $config['queue'],
19
            $config['connection'] ?? $this->connection,
20
            $config['retry_after'] ?? 60,
21
            $config['block_for'] ?? null
22
        );
23
    }
24
}
25