-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Channel onUndeliveredElement doesn't work #3330
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
Comments
This is indeed a bug, but it seems to be only fixable in 1.7.0. The story is the following:
So we have to fix all channels except |
While we're evaluating it, could you folks please describe your use case for this? |
My use case from #3327 is that I am using a bounded channel in a thread that receives some data, processes it, then sends it over the network. Sometimes, the network takes longer than expected so the channel reaches max capacity and the Edit: I'm wondering if it would be better in a callback or if the |
We have almost the same use case. We receive some data from the network and send items to a channel while the background worker processes them. When we have too many messages we'd like to drop the oldest. Planned to use callback for metrics and logging. |
Thanks, folks! That's not the use-cases we expected when designing this API, but they are definitely the ones we'd like to support |
Marked as "fixes 3330" to automatically close the issue yet it's the original PR that fixed it Fixes #3330
Fixed by #3621 |
I wanted to use channel with buffer but was disappointed to find out that it doesn't work as expected.
When I use a channel with capacity = 1, like this:
It works perfectly as I want, output:
So I expected the same behavior with greater capactity = 2:
But onUndeliveredElement never called in that case
BufferOverflow.DROP_LATEST doesn't work either.
The text was updated successfully, but these errors were encountered: