MCPcopy Create free account
hub / github.com/taskforcesh/bullmq / __construct

Method __construct

php/src/Queue.php:64–80  ·  view source on GitHub ↗

* Create a new Queue instance. * * @param string $name The name of the queue * @param array{ * prefix?: string, * connection?: RedisConnection|array |string * } $opts Queue options */

(string $name, array $opts = [])

Source from the content-addressed store, hash-verified

62 * } $opts Queue options
63 */
64 public function __construct(string $name, array $opts = [])
65 {
66 $this->name = $name;
67 $this->prefix = $opts['prefix'] ?? 'bull';
68
69 // Handle connection option
70 $connection = $opts['connection'] ?? [];
71 if ($connection instanceof RedisConnection) {
72 $this->connection = $connection;
73 } else {
74 $this->connection = new RedisConnection($connection);
75 $this->ownsConnection = true;
76 }
77
78 $this->keys = new QueueKeys($this->prefix);
79 $this->scripts = new Scripts($this->prefix, $this->name, $this->connection);
80 }
81
82 /**
83 * Get the Redis connection.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected