Add explanation to channel magic
This commit is contained in:
parent
fa240a37db
commit
f2d1fbdfa5
@ -243,6 +243,10 @@ func (mp *MessagePool) Close() error {
|
||||
}
|
||||
|
||||
func (mp *MessagePool) Prune() {
|
||||
//so, its a single slot buffered channel. The first send fills the channel,
|
||||
//the second send goes through when the pruning starts,
|
||||
//and the third send goes through (and noops) after the pruning finishes
|
||||
//and goes through the loop again
|
||||
mp.pruneTrigger <- struct{}{}
|
||||
mp.pruneTrigger <- struct{}{}
|
||||
mp.pruneTrigger <- struct{}{}
|
||||
|
Loading…
Reference in New Issue
Block a user