arempe93 / bunny-mock

A mock client for RabbitMQ modeled after the Bunny client in ruby
http://www.rubydoc.info/github/arempe93/bunny-mock
MIT License
44 stars 37 forks source link

Queue.subscribe! #20

Closed baelter closed 8 years ago

baelter commented 8 years ago

In-memory implementation of http://reference.rubybunny.info/Bunny/Queue.html#subscribe-instance_method

coveralls commented 8 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 5fc52d1c5ad563c2f163d1a85ba3ee654893f659 on baelter:master into 1f045d3c46e34582380aa6003d8a8722b3fd971f on arempe93:master.

arempe93 commented 8 years ago

Thanks for this implementation! I will look at it more closely later tonight

coveralls commented 8 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 6d99da007e883787670b7981a062f7a050d1a68c on baelter:master into 1f045d3c46e34582380aa6003d8a8722b3fd971f on arempe93:master.

baelter commented 8 years ago

You can hold this PR until further notice, I've found some shortcomings I want to fix.

coveralls commented 8 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling ba08f62c35b7a013287d57da0eec7d3fea1f0c5d on baelter:master into 1f045d3c46e34582380aa6003d8a8722b3fd971f on arempe93:master.

baelter commented 8 years ago

Ok @arempe93, happy with this now.

Added support for multiple routes with them same key. Basically Exchange::routes hash items are arrays of routes instead.

arempe93 commented 8 years ago

Looks pretty good to me - only question is why call yield_consumers in the subscribe method? I can't think of a case where it would do anything - but maybe there is

baelter commented 8 years ago

Reason for that is that if there are messages in the queue they will be delivered when a consumer subscribes.

arempe93 commented 8 years ago

Ok - that makes sense. For some reason I didn't think of the case that there could be messages entered into the queue before a subscription happens.

baelter commented 8 years ago

Sweet, when are u planning next release?

arempe93 commented 8 years ago

Probably when I have time after work today. I don't think there's anything else in progress right now