Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Channel Exceptions, Channel Closes, etc don't inform Consumers #99

Closed
rajmaniar opened this issue Jul 28, 2023 · 1 comment · Fixed by #102
Closed

Channel Exceptions, Channel Closes, etc don't inform Consumers #99

rajmaniar opened this issue Jul 28, 2023 · 1 comment · Fixed by #102

Comments

@rajmaniar
Copy link
Contributor

When a channel exception is thrown or channel is closed the Consumer's error or done callbacks are not invoked.

Consider:

var c = Client();
var chan = await c.channel();
var queue = await chan.queue("test123", autoDelete: true);
var consumer = await queue.consume(noAck: true);
consumer.listen((event) {print("queue: $event");}, onDone: (){print("consumer done");}, onError: (e){print("consumer error: $e");}, cancelOnError: true);

try {
    await chan.queue("test456", passive: true);
 } on QueueNotFoundException {
    print("QueueNotFoundException will break the channel");
}
await Future.delayed(Duration(seconds: 60));

In the above scenario the consumer done or consumer error are never emitted and the stream isn't closed.

It seems to me the channel exception handler should loop over all the consumer stream controllers, pass the error down and/or close the streams.

@achilleasa
Copy link
Owner

Thanks for reporting this! A fix is on the way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants