A simple interface wrapper around a Go channel.
// Make new channel. Provide a length to make a buffered channel.
func Make(length int) C
type C interface {
// Send a messge to the channel. Returns false if the channel is closed.
Send(v interface{}) (ok bool)
// Recv a messge from the channel. Returns false if the channel is closed.
Recv() (v interface{}, ok bool)
// Close the channel. Returns false if the channel is already closed.
Close() (ok bool)
// Wait for the channel to close. Returns immediately if the channel is
// already closed
Wait()
}
Josh Baker @tidwall
chanx source code is available under the MIT License.