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

Interaction between ChannelError and Select #73

Open
ytoh opened this issue Dec 17, 2024 · 1 comment
Open

Interaction between ChannelError and Select #73

ytoh opened this issue Dec 17, 2024 · 1 comment

Comments

@ytoh
Copy link

ytoh commented Dec 17, 2024

Hello!

I have built an abstraction that internally use Channels. I am now designing the exception handling for it. When I read from a single channel everything is clear, I can translate ChannelError to whatever I need and provide context of my abstraction.

Where I have a problem is when I use Select#select. In this case, when an error occurs I do not know from which channel it originates and I have to go through all of them to check whether I have the correct one.

Would it be possible to either expose the channel on ChannelClosed or allow some sort of metadata to be attached to a channel that would then be accessible on ChannelClosed? Or is there a better way of doing such a thing?

I am willing to work on it myself if you deem such a feature desirable.

Thanks

@adamw
Copy link
Member

adamw commented Dec 17, 2024

Yes, I think it's the same as #64?
If you could attempt a PR, I'll be happy to review.

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

No branches or pull requests

2 participants