// add a producer to a registration
489916
func (r *RegistrationDB) AddProducer(k Registration, p *Producer) bool {
	r.Lock()
	defer r.Unlock()
	_, ok := r.registrationMap[k]
	if !ok {
		r.registrationMap[k] = make(map[string]*Producer)
	}
	producers := r.registrationMap[k]
	_, found := producers[p.peerInfo.id]
	if found == false {
		producers[p.peerInfo.id] = p
	}
	return !found
}
481107
func (s *StreamingRpcRegistry) Register(method string, handler StreamingRpcHandler) {
	s.registry[method] = handler
}
1301252
func (t *ProgressEmitter) Register(s *sharedPullerState) {
	t.mut.Lock()
	defer t.mut.Unlock()
	if t.disabled {
		l.Debugln("progress emitter: disabled, skip registering")
		return
	}
	l.Debugln("progress emitter: registering", s.folder, s.file.Name)
	if t.emptyLocked() {
		t.timer.Reset(t.interval)
	}
	if _, ok := t.registry[s.folder]; !ok {
		t.registry[s.folder] = make(map[string]*sharedPullerState)
	}
	t.registry[s.folder][s.file.Name] = s
}
1070437
func (ctx *workflowContext) registerFinalizer(userFunction finalizerFunction) {
	if nil == ctx.transaction.finalizerFunctions || len(ctx.transaction.finalizerFunctions) <= 0 {
		ctx.transaction.finalizerFunctions = make([]finalizerFunction, 0)
	}
	ctx.transaction.finalizerFunctions = append(ctx.transaction.finalizerFunctions, userFunction)
}
640665
func (tpl *Template) RegisterHelper(name string, helper interface{}) {
	tpl.mutex.Lock()
	defer tpl.mutex.Unlock()

	if tpl.helpers[name] != zero {
		panic(fmt.Sprintf("Helper %s already registered", name))
	}

	val := reflect.ValueOf(helper)
	ensureValidHelper(name, val)

	tpl.helpers[name] = val
}
1302837
func Register() {
	registerMetrics.Do(func() {
		prometheus.MustRegister(zoneHealth)
		prometheus.MustRegister(zoneSize)
		prometheus.MustRegister(unhealthyNodes)
		prometheus.MustRegister(evictionsNumber)
	})
}
1351334
func Register(r types.ConfigRegistration) {
	registrationsRWL.Lock()
	defer registrationsRWL.Unlock()
	for x, rr := range registrations {
		if rr.Name() == r.Name() {
			registrations[x] = r
			return
		}
	}
	registrations = append(registrations, r)
}
1354972
func (queue *redisQueue) AddConsumer(tag string, consumer Consumer) string {
	queue.stopWg.Add(1)
	name := queue.addConsumer(tag)
	go queue.consumerConsume(consumer)
	return name
}
145386
func Register(server *grpc.Server, node *Node) {
	api.RegisterRaftServer(server, node)
	api.RegisterRaftMembershipServer(server, node)
}
836286
func (registry streamRegistry) AddWildcardProducersToRouter(router Router) {
	streamID := router.GetStreamID()
	if streamID != LogInternalStreamID {
		router.AddProducer(registry.wildcard...)
	}
}
1307365
func (m *Mixer) Add(s ...Streamer) {
	m.streamers = append(m.streamers, s...)
}
212164
func (o *TodoListAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer {

	result := make(map[string]runtime.Producer)
	for _, mt := range mediaTypes {
		switch mt {

		case "application/io.goswagger.examples.todo-list.v1+json":
			result["application/io.goswagger.examples.todo-list.v1+json"] = o.JSONProducer

		}

		if p, ok := o.customProducers[mt]; ok {
			result[mt] = p
		}
	}
	return result

}
804968
func (reg *WatchDataReg) Register(resyncName, keyPrefix string) error {
	reg.adapter.access.Lock()
	defer reg.adapter.access.Unlock()

	for resName, sub := range reg.adapter.subscriptions {
		if resName == resyncName {
			// Verify that prefix does not exist yet
			for _, regPrefix := range sub.KeyPrefixes {
				if regPrefix == keyPrefix {
					return fmt.Errorf("prefix %q already exists", keyPrefix)
				}
			}
			sub.KeyPrefixes = append(sub.KeyPrefixes, keyPrefix)
			return nil
		}
	}
	return fmt.Errorf("cannot register prefix %s, resync name %s not found", keyPrefix, resyncName)
}
126348
func (cgi *ConsumergroupInstance) Register(topics []string) error {
	subscriptionJSON, err := cgi.marshalSubscription(topics)
	if err != nil {
		return err
	}

	return cgi.RegisterWithSubscription(subscriptionJSON)
}
1028751
func (tsv *TabletServer) Register() {
	for _, f := range RegisterFunctions {
		f(tsv)
	}
	tsv.registerDebugHealthHandler()
	tsv.registerQueryzHandler()
	tsv.registerStreamQueryzHandlers()
	tsv.registerTwopczHandler()
}
982600
func (o *OauthSampleAPI) RegisterProducer(mediaType string, producer runtime.Producer) {
	o.customProducers[mediaType] = producer
}
1312888
func (m *Manager) RegisterCompilerTrigger(f func(txn storage.Transaction)) {
	m.mtx.Lock()
	defer m.mtx.Unlock()
	m.registeredTriggers = append(m.registeredTriggers, f)
}