juriansluiman/SlmQueue — pull request #110 by juriansluiman (2014-08-06 19:56:24+00:00)
Title: Do not use queue name in Worker::processQueue($queue, $options);

Proposal: why not move the queue instantiation from the worker to the controller, which feels more logical to me.

Current controller:
```php
public function __construct(WorkerInterface $worker)
{ /* ... */ }

public function processAction()
{
// work
$this->worker->processQueue($queueName, $options);
// work
}
```

Current Worker:
```php
public function __construct(QueuePluginManager $queuePluginManager)
{ /* ... */ }

public function processQueue($queueName, $options)
{
$queue = $this->queuePluginManager->get($queueName);
//work
}
```

**NEW PROPOSAL**
Controller:
```php
public function __construct(WorkerInterface $worker, QueuePluginManager $queuePluginManager)
{ /* ... */ }

public function processAction()
{
// work
$queue = $this->queuePluginManager->get($queueName);
$this->worker->processQueue($queue, $options);
// work
}
```

Current Worker:

```php
// No constructor!

public function processQueue(QueueInterface $queue, $options)
{
//work
}
```

Ping @basz @bakura10; not started this because many tests should be rewritten and obviously clashes now with the worker listeners PR. So if agreed, I'll do this for v0.4 just after Bas's PR is merged.