1
0
Fork 0
This commit is contained in:
Gregory Eremin 2014-09-10 16:53:41 +04:00
parent 69b94c077f
commit d913f52efa
1 changed files with 2 additions and 0 deletions

View File

@ -23,6 +23,7 @@ func (h *Hub) Pub(queue string, msg []byte) bool {
if s.Queue == queue {
select {
case <-s.Done():
// FIXME: Cleanup needed
continue
default:
}
@ -42,6 +43,7 @@ func (h *Hub) Sub(s *Subscription) {
if msg, ok := h.storage.Get(s.Queue); ok {
s.Send(msg)
} else {
// FIXME: Race condition
h.subscribers = append(h.subscribers, s)
}
}