Currently basicCancel() needs to be called explicitly when iteration has finished - it can be done automatically on consumer deinit.
for await msg in consumer {
guard case .success(let delivery) = msg else {
print("Delivery failure", msg)
return
}
print("Succesfully consumed a message", delivery)
break
}
try await channel.basicCancel(consumerTag: consumer.name) // users should not have to call this. this should be automatic once you leave the iteration
Currently basicCancel() needs to be called explicitly when iteration has finished - it can be done automatically on consumer deinit.