Skip to content

Commit

Permalink
Merge pull request #35 from Vinelab/fix/handler-memory-management
Browse files Browse the repository at this point in the history
Consumer: move handler initialisation to inside the message receipt callback
  • Loading branch information
Mulkave authored Nov 12, 2018
2 parents d148f55 + 4599ac8 commit af8f56e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Consumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ public function listenToQueue($handlerClass, BowlerExceptionHandler $exceptionHa
$channel->queue_bind($this->queueName, $this->exchangeName);
}

// Instantiate Handler
$queueHandler = app($handlerClass);
$callback = function ($message) use ($handlerClass, $exceptionHandler) {
// Instantiate Handler
$queueHandler = app($handlerClass);

$callback = function ($message) use ($queueHandler, $exceptionHandler) {
$broker = new MessageBroker($message);

try {
Expand Down

0 comments on commit af8f56e

Please sign in to comment.