Skip to content

Commit

Permalink
Merge branch 'pr-479'
Browse files Browse the repository at this point in the history
  • Loading branch information
makasim committed Aug 4, 2018
2 parents 6ca7a14 + b4aaeac commit 18c7e4a
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions pkg/amqp-ext/AmqpContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ public function subscribe(InteropAmqpConsumer $consumer, callable $callback)

$consumerTag = $extQueue->getConsumerTag();
$consumer->setConsumerTag($consumerTag);
$this->subscribers[$consumerTag] = [$consumer, $callback];
$this->subscribers[$consumerTag] = [$consumer, $callback, $extQueue];
}

/**
Expand All @@ -327,15 +327,13 @@ public function unsubscribe(InteropAmqpConsumer $consumer)
return;
}

// seg fault
// $consumerTag = $consumer->getConsumerTag();
// $consumer->setConsumerTag(null);
//
// $extQueue = new \AMQPQueue($this->getExtChannel());
// $extQueue->setName($consumer->getQueue()->getQueueName());
//
// $extQueue->cancel($consumerTag);
// unset($this->subscribers[$consumerTag]);
$consumerTag = $consumer->getConsumerTag();
$consumer->setConsumerTag(null);

list($consumer, $callback, $extQueue) = $this->subscribers[$consumerTag];

$extQueue->cancel($consumerTag);
unset($this->subscribers[$consumerTag]);
}

/**
Expand Down

0 comments on commit 18c7e4a

Please sign in to comment.