Feat v0.6.6 final hardening (#41)
All checks were successful
All checks were successful
Co-authored-by: Jeffrey Smith <jasafpro@gmail.com> Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #41.
This commit is contained in:
@@ -112,6 +112,8 @@ func (b *Bus) publishLocal(event Event) {
|
||||
// in separate goroutines. Useful for I/O-heavy handlers.
|
||||
// Also calls the broadcastHook asynchronously if set.
|
||||
func (b *Bus) PublishAsync(event Event) {
|
||||
b.publishCount.Add(1)
|
||||
|
||||
b.mu.RLock()
|
||||
var matched []Handler
|
||||
for pattern, subs := range b.subs {
|
||||
@@ -125,6 +127,7 @@ func (b *Bus) PublishAsync(event Event) {
|
||||
b.mu.RUnlock()
|
||||
|
||||
for _, h := range matched {
|
||||
b.deliverCount.Add(1)
|
||||
go h(event)
|
||||
}
|
||||
if hook != nil {
|
||||
|
||||
Reference in New Issue
Block a user