I'm using such a select
on multiple cases:
for {
select {
case data:= <- highFreqChan:
// do something:
case <- time.After(time.Second * 5):
// send some heartbeat like data...
}
}
I find that, if highFreqChan
got huge data, the heartbeat case will not enter, and when stop sending data to highFreqChan
, the heartbeat case alive again, how to make it always enter the heartbeat case while the highFreqChan
still working?