About the Implementation Logic of SendToChannel Function #148
|
func SendToChannel[T any](ctx context.Context, c chan<- T, e interface{}) bool { I think we need to implement "case" priority control. If chan has a buffer, when "c<- e. (T)" and "<- ctx. Done()" both satisfy simultaneously, "select" will randomly execute one of them. What should our goal be?
|
Answered by
RobertIndie
Feb 21, 2024
Replies: 1 comment
|
Just reviewed your code and left some comments: #140 (review) Option 1 sounds good to me. We don't need to give a strong guarantee for the priority. If the |
0 replies
Answer selected by
RobertIndie
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just reviewed your code and left some comments: #140 (review)
Option 1 sounds good to me. We don't need to give a strong guarantee for the priority. If the
SendToChannelreturns true, that doesn't mean the ctx hasn't done.