// Remove remove a handler of specific topic from redisDispatcher
Remove remove a handler of specific topic from redisDispatcher
// Remove remove a handler of specific topic from redisDispatcher
func (d *redisDispatcher) Remove(ctx context.Context, topic Topic, handler HandleFunc) bool {
	if d.isStopped() {
		return false
	}
	d.Lock()
	defer d.Unlock()
	for tpc, handlers := range d.handlers {
		if tpc == topic {
			for i, h := range handlers {
				if reflect.ValueOf(h).Pointer() == reflect.ValueOf(handler).Pointer() {
					d.handlers[tpc] = append(handlers[:i], handlers[i+1:]...)
					return true
				}
			}
		}
	}
	return false
}
func ( d * redisDispatcher ) Remove ( ctx context . Context , topic Topic , handler HandleFunc ) bool { if d . isStopped ( ) { return false } d . Lock ( ) defer d . Unlock ( ) for tpc , handlers := range d . handlers { if tpc == topic { for i , h := range handlers { if reflect . ValueOf ( h ) . Pointer ( ) == reflect . ValueOf ( handler ) . Pointer ( ) { d . handlers [ tpc ] = append ( handlers [ : i ] , handlers [ i + 1 : ] ... ) return true } } } } return false }
Remove remove a handler of specific topic from redisDispatcher
Remove remove a handler of specific topic from redisDispatcher