// Dispatch dispatches a event by invoking each callback asynchronously.
Dispatch dispatches a event by invoking each callback asynchronously.
// Dispatch dispatches a event by invoking each callback asynchronously .
func (b *bus) Dispatch(event *Event) {
	if actual, ok := b.callbacks.Load(event.Name); ok {
		for _, h := range actual.([]Callback) {
			gofunc.GoFunc(context.Background(), func() {
				h(event)
			})
		}
	}
}
func ( b * bus ) Dispatch ( event * Event ) { if actual , ok := b . callbacks . Load ( event . Name ) ; ok { for _ , h := range actual . ( [ ] Callback ) { gofunc . GoFunc ( context . Background ( ) , func ( ) { h ( event ) } ) } } }
Dispatch dispatches a event by invoking each callback asynchronously.
Dispatch dispatches a event by invoking each callback asynchronously .