getDriver method

QueueDriver getDriver([
  1. String? name
])

Gets a specific queue driver instance.

If name is provided, returns the driver with that name. Otherwise, returns the default driver.

Throws QueueException if the requested driver is not registered.

Implementation

QueueDriver getDriver([String? name]) {
  if (name != null) {
    final driver = _registry.getDriver(name);
    if (driver == null) {
      throw QueueException('Queue driver "$name" not registered');
    }
    return driver;
  }
  return _registry.getDefaultDriver();
}