[go-nuts] Why have an empty default case when sending heartbeats

2017-10-01 Thread Tamás Gulácsi
To skip send if nothing is receiving, avoiding the block. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more optio

[go-nuts] Why have an empty default case when sending heartbeats

2017-10-01 Thread go-question
In the following snippet for having a function representing work send a heartbeat to any listeners. Why is a select statement used in `sendPulse` instead of just executing `heartbeat <- struct{}{}`? And why provide an empty default case? doWork := func( done <-chan interface{}, pulseInterval t