From 7f6aad20fbad6ef1a132d5a8bebd18f3521fff1a Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Fri, 4 Mar 2016 22:04:05 -0800 Subject: [PATCH] Add note on nondeterminism of Broadcast --- switch.go | 1 + 1 file changed, 1 insertion(+) diff --git a/switch.go b/switch.go index 72a599ab3..518c6dfa2 100644 --- a/switch.go +++ b/switch.go @@ -301,6 +301,7 @@ func (sw *Switch) IsDialing(addr *NetAddress) bool { // Broadcast runs a go routine for each attempted send, which will block // trying to send for defaultSendTimeoutSeconds. Returns a channel // which receives success values for each attempted send (false if times out) +// NOTE: Broadcast uses goroutines, so order of broadcast may not be preserved. func (sw *Switch) Broadcast(chID byte, msg interface{}) chan bool { successChan := make(chan bool, len(sw.peers.List())) log.Info("Broadcast", "channel", chID, "msg", msg)