Skip to content

Commit

Permalink
add method to get queue after build
Browse files Browse the repository at this point in the history
  • Loading branch information
dhanielo committed Jan 11, 2017
1 parent bb02de4 commit 9def546
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Queue/QueueBuilderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,9 @@ interface QueueBuilderInterface
* @return Queue
*/
public function buildQueue($queueName, QueueServiceInterface $queueService, QueueBagInterface $queueBag);

/**
* @return Queue
*/
public function getQueue();
}
10 changes: 10 additions & 0 deletions Transport/PubSub/SubscriberBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

class SubscriberBuilder implements QueueBuilderInterface
{
private $queue;
private $connectionManager;
private $logger;

Expand All @@ -36,6 +37,7 @@ public function buildQueue($queueName, QueueServiceInterface $queueService, Queu
$queue = new Queue($this->getConnectionManager(), $queueBag, $this->logger);
$queueCallback = new SubscriberQueueCallback($queueService);
$queue->setCallback($queueCallback);
$this->queue = $queue;

return $queue;
}
Expand All @@ -47,4 +49,12 @@ public function getConnectionManager()
{
return $this->connectionManager;
}

/**
* @return Queue
*/
public function getQueue()
{
return $this->queue;
}
}
10 changes: 10 additions & 0 deletions Transport/Rpc/RpcServerBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

class RpcServerBuilder implements QueueBuilderInterface
{
private $queue;
private $connectionManager;
private $logger;

Expand All @@ -36,6 +37,7 @@ public function buildQueue($queueName, QueueServiceInterface $queueService, Queu
$queue = new Queue($this->getConnectionManager(), $queueBag, $this->logger);
$queueCallback = new RpcQueueCallback($queueService);
$queue->setCallback($queueCallback);
$this->queue = $queue;

return $queue;
}
Expand All @@ -47,4 +49,12 @@ public function getConnectionManager()
{
return $this->connectionManager;
}

/**
* @return Queue
*/
public function getQueue()
{
return $this->queue;
}
}
10 changes: 10 additions & 0 deletions Transport/Worker/WorkerBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

class WorkerBuilder implements QueueBuilderInterface
{
private $queue;
private $connectionManager;
private $logger;

Expand All @@ -37,6 +38,7 @@ public function buildQueue($queueName, QueueServiceInterface $queueService, Queu
$queue = new Queue($this->getConnectionManager(), $queueBag, $this->logger);
$queueCallback = new WorkerQueueCallback($queueService);
$queue->setCallback($queueCallback);
$this->queue = $queue;

return $queue;
}
Expand All @@ -48,4 +50,12 @@ public function getConnectionManager()
{
return $this->connectionManager;
}

/**
* @return Queue
*/
public function getQueue()
{
return $this->queue;
}
}

0 comments on commit 9def546

Please sign in to comment.