//Register add a handler func to specific topic
Register add a handler func to specific topic
// Register add a handler func to specific topic
func (d *localDispatcher) Register(ctx context.Context, topic Topic, handler HandleFunc) error {
	if d.isStopped() {
		return ErrDispatcherNotWorking
	}
	if nil == d.events[topic] {
		d.events[topic] = newEvents(d.options.ParallelThreshold)
	}
	events := d.events[topic]
	return events.AddHandleFunc(ctx, handler)
}
func ( d * localDispatcher ) Register ( ctx context . Context , topic Topic , handler HandleFunc ) error { if d . isStopped ( ) { return ErrDispatcherNotWorking } if nil == d . events [ topic ] { d . events [ topic ] = newEvents ( d . options . ParallelThreshold ) } events := d . events [ topic ] return events . AddHandleFunc ( ctx , handler ) }
Register add a handler func to specific topic
Register add a handler func to specific topic