Channel Size is One or None
Channels should usually have a size of one or be unbuffered. By default,channels are unbuffered and have a size of zero. Any other sizemust be subject to a high level of scrutiny. Consider how the size isdetermined, what prevents the channel from filling up under load and blockingwriters, and what happens when this occurs.
Bad | Good |
---|---|
|
|