Although it is feasible to rely on close(ch.In) to cancel the process, it is necessary to ensure that close(ch.In) must be executed after ch.In<-v when using it.
It is inconvenient, because the two may be in different goroutine.
So I suggest providing additional channels to handle this.
Although it is feasible to rely on
close(ch.In)
to cancel the process, it is necessary to ensure thatclose(ch.In)
must be executed afterch.In<-v
when using it. It is inconvenient, because the two may be in different goroutine. So I suggest providing additional channels to handle this.