viartemev/rabbitmq-kotlin

Leak in the consumer

Closed this issue · 2 comments

the offer operation is not blocking, but it will return false if the queue is full. It's coroutines leak.

val delivery = suspendCancellableCoroutine<Delivery> { continuations.offer(it) }

Possible options are:

  • put(). At the same time, it's a blocking operation -> use special dispatcher for it?
  • Kotlin Channel, but you can't consume from the channel in the DeliveryCallback

Channel has sendBlocking method