Skip to content

Commit

Permalink
making sure that listeners are notified on their own go routine to no…
Browse files Browse the repository at this point in the history
…t block the sender
  • Loading branch information
zabawaba99 committed Mar 5, 2016
1 parent 3fd8c89 commit bc1b6a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion exchange/exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (ex *Exchange) Listen(event string, fn func(interface{})) {
func (ex *Exchange) Send(event string, data interface{}) {
ex.mtx.RLock()
for _, fn := range ex.queues[event] {
fn(data)
go fn(data)
}
ex.mtx.RUnlock()
}

0 comments on commit bc1b6a6

Please sign in to comment.