* 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 = [])
| 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. |
nothing calls this directly
no outgoing calls
no test coverage detected