Closed sappleg closed 8 years ago
@tjmehta can't seem to get line 21 of assert-and-consume-app-queue.js covered by specs. Any clues?
Hey, nice I'm actually out of the office for a few hours but I can definitely wrap this up for you when I get back
I also think this may be better to add as an additional option to connect. Since queue is already taking quite a by of options. But let me know what you think
@tjmehta Is this more along the lines of what you are thinking? If so, I need to make sure connect
can correctly take the optional prefetch
argument
Im checking this out now
Hey I was going to branch off this PR, but I ended up implementing a brand new method to handle this app.prefetch(...)
. I think this way is cleaner than overloading the existing methods, sorry about that. So I am going to close this. PR #41
Adds ability to specify a prefetch count on a consumer channel in accordance to amqplib's documentation. Requested in #38
The implementation uses the existing infrastructure around passing consumer options to the consumer channel during connection. It will check for the presence of a
prefetch
key in theconsumeOpts
object and call theprefetch
method on theconsumerChannel
while passing in the provided value forprefetch
in theconsumeOpts
object. It will then delete theprefetch
key from theconsumeOpts
object if it exists as to not change how the system works down the line.I could see how this could be viewed as hacky. @tjmehta, let me know if you had a cleaner implementation in mind to get the prefetch count to the
assertAndConsumeAppQueue
method.