diff --git a/hub.go b/hub.go index e9efd27..d68ef08 100644 --- a/hub.go +++ b/hub.go @@ -48,7 +48,12 @@ func (h *Hub) Run() { } h.circbuf.Do(func(x interface{}) { if x != nil { - cl.Messages <- x.(format.LogParts) + select { // send without blocking + case cl.Messages <- x.(format.LogParts): + break + default: + break + } } }) if cl.Nofollow { @@ -65,7 +70,12 @@ func (h *Hub) Run() { h.circbuf.Value = msg h.circbuf = h.circbuf.Next() for client := range h.clients { - client.Messages <- msg + select { // send without blocking + case client.Messages <- msg: + break + default: + break + } } } }