-
Notifications
You must be signed in to change notification settings - Fork 440
Add AmqpLib support #136
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
Add AmqpLib support #136
Conversation
composer.json
Outdated
@@ -7,6 +7,7 @@ | |||
"enqueue/enqueue": "*@dev", | |||
"enqueue/stomp": "*@dev", | |||
"enqueue/amqp-ext": "*@dev", | |||
"enqueue/amqplib": "*@dev", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please rename it to amqp-lib
? Same goes for the composer package name
private $config; | ||
private $connection; | ||
|
||
public function __construct(array $config = []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please add doc blocks for the properties and methods
pkg/amqplib/AmqpConsumer.php
Outdated
class AmqpConsumer implements PsrConsumer | ||
{ | ||
private $channel; | ||
private $queue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we use php-cs-fixer to make sure the code looks similar. Could you please use it too? https://github.com/php-enqueue/enqueue-dev/blob/master/docs/contribution.md
pkg/amqplib/AmqpConsumer.php
Outdated
|
||
public function receive($timeout = 0) | ||
{ | ||
$end = microtime(true) + ($timeout / 1000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be good to add a basic_consume
support. But it could be done at a later stage.
@@ -0,0 +1,49 @@ | |||
<?php | |||
|
|||
namespace Enqueue\Amqplib; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please change it to Enqueue\AmqpLib
?
@fibula It would be also great if you could add some tests. You can use https://github.com/queue-interop/queue-spec |
pkg/amqp-lib/AmqpConsumer.php
Outdated
{ | ||
$end = microtime(true) + ($timeout / 1000); | ||
|
||
while (0 === $timeout || microtime(true) < $end) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be able to add a support of basic_consume
. You can look how we did it in amqp ext transport
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I will give a try
fixes #128