You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm changing it right now to just use RPOPLPUSH until either the delivery channel is full or the source redis list is empty (RPOPLPUSH return (nil)). That way we get rid of LLEN.
I did consider using BRPOPLPUSH but there seems to be a problem. If the queue is empty and no new deliveries get produced, if the consumer is blocked on PRPOPLPUSH and calls queue.StopConsuming() (from a different goroutine), then we don't get a chance to check the consumingStopped value inside of consume() and will remain blocked forever.
For that reason I'm closing this issue. Thanks for the suggestion though! 🙌
rmq/queue.go
Line 332 in 507bf31
consume
now call LLEN && RPOPLPUSH to gain queue message from redis.BRPOPLPUSH can get rid of that LLEN call, should be more efficient.
The text was updated successfully, but these errors were encountered: