Skip to content

Conversation

@San9H0
Copy link

@San9H0 San9H0 commented Oct 17, 2022

If you input to closed channel, we face error panic: Input to a closed channel

It actually happened when taskQueue <- task in Submit function in my project

I am using Stopped() function for check. This does not guarantee that the channel is not closed.

and I think most application is N Senders model for channel.

This fix will be necessary

@gammazero
Copy link
Owner

Consider using recover to catch the "send on closed channle" error. Here is an example: https://github.com/gammazero/workerpool/pull/80/files#. Please also see the comments here for explanation why panic is wanted: #77 (comment)

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 this pull request may close these issues.

2 participants