Event Hub: Use NonBlockingSubscribe to avoid deadlocks #391
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
parent
138dabd0c8
commit
d3f3b24ba3
1 changed files with 2 additions and 2 deletions
|
@ -9,7 +9,7 @@ type Hub = hub.Hub
|
|||
type Data = hub.Fields
|
||||
type Message = hub.Message
|
||||
|
||||
var channelCap = 10
|
||||
var channelCap = 100
|
||||
var sharedHub = NewHub()
|
||||
|
||||
func NewHub() *Hub {
|
||||
|
@ -64,7 +64,7 @@ func Publish(event string, data Data) {
|
|||
}
|
||||
|
||||
func Subscribe(topics ...string) hub.Subscription {
|
||||
return SharedHub().Subscribe(channelCap, topics...)
|
||||
return SharedHub().NonBlockingSubscribe(channelCap, topics...)
|
||||
}
|
||||
|
||||
func Unsubscribe(s hub.Subscription) {
|
||||
|
|
Loading…
Reference in a new issue