Go - select

Syntax The select statement waits for multiple send or receive operations simultaneously. // Blocks until there's data available on ch1 or ch2 select { case <-ch1: fmt.Println("Received from ch1") case <-ch2: fmt.Println("Received from ch2") } The statement blocks as a whole until one of the operations becomes unblocked. If several cases can proceed, a single one of them will be chosen at random. Send and receive operations on a nil channel block forever. [Read More]