Skip to content

Add shutdown method. When called kernel shutdown, we must close opene… #365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 31, 2016
Merged

Conversation

shustrik
Copy link
Contributor

@shustrik shustrik commented Jun 8, 2016

When kernel shutdown is called, we must close opened connections. For example behat with symfony2 extension uses kernel shutdown for each scenario.

$partHolder = $this->container->get('old_sound_rabbit_mq.parts_holder');
$connections = $partHolder->getParts("old_sound_rabbit_mq.base_amqp");
foreach ($connections as $connection) {
$connection->__destruct();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or extract method closeConnection() in BaseAmqp

@shustrik shustrik changed the title add shutdown method. When called kernel shutdown, we must close opene… Add shutdown method. When called kernel shutdown, we must close opene… Jun 9, 2016
} catch (\Exception $e) {
// ignore on shutdown
}
$this->ch->close();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why you removed the try/catch ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My mistake. Add try catch

@skafandri skafandri merged commit 0182f8e into php-amqplib:master Jul 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants