pg
pg copied to clipboard
avoid explicitly close all data channels to prevent panics
The solution is very simple and less intrusive.
Rule 1: Don't close all dataCh, let GC handle. Rule 2: Make sure when ctx.Done() is triggered, all senders and receivers will finish. So the GC is happy to release the channel.
To figure out all ownership probems of send on closed channel of the project is impossible, it requires a clear design when write the first line code.
will fix #38