// AddGroupedCallback adds a collector to a specific group.
553831
func (s *Scheduler) AddGroupedCallback(group string, db Collector) {
	s.callbackMutex.Lock()
	defer s.callbackMutex.Unlock()
	subgroup, exists := s.callbackMap[group]
	if !exists {
		subgroup = &callbackPair{
			callbacks:         map[Collector]struct{}{db: {}},
			defaultDimensions: map[string]string{},
		}
		s.callbackMap[group] = subgroup
	}
	subgroup.callbacks[db] = struct{}{}
}
705009
func (cli *grpcClient) SetResponseCallback(resCb Callback) {
	cli.mtx.Lock()
	cli.resCb = resCb
	cli.mtx.Unlock()
}
933312
func (c CallList) AddAll(selector string, idents ...string) {
	for _, ident := range idents {
		c.Add(selector, ident)
	}
}
374522
func (builder *MapReduceCommandBuilder) WithCallback(callback func([]byte) error) *MapReduceCommandBuilder {
	builder.callback = callback
	return builder
}
1311540
func (b *Backend) GroupCompleted(groupUUID string, groupTaskCount int) (bool, error) {
	conn, channel, err := b.Open(b.GetConfig().Broker, b.GetConfig().TLSConfig)
	if err != nil {
		return false, err
	}
	defer b.Close(channel, conn)

	queueState, err := b.InspectQueue(channel, groupUUID)
	if err != nil {
		return false, nil
	}

	return queueState.Messages == groupTaskCount, nil
}
675617
func (b *batchAgg) Add(ev interface{}) {
	// from muster godoc: "The Batch does not need to be safe for concurrent
	// access; synchronization will be handled by the Client."
	if b.batches == nil {
		b.batches = map[string][]*Event{}
	}
	e := ev.(*Event)
	// collect separate buckets of events to send based on the trio of api/wk/ds
	// if all three of those match it's safe to send all the events in one batch
	key := fmt.Sprintf("%s_%s_%s", e.APIHost, e.APIKey, e.Dataset)
	b.batches[key] = append(b.batches[key], e)
}
525940
func (em *EventMeter) RegisterDisconnectCallback(f DisconnectCallbackFunc) {
	em.mtx.Lock()
	defer em.mtx.Unlock()
	em.disconnectCallback = f
}
529390
func (manager *configManager) execClusterCallbacks(f CallbackClusterConfigFunc, data *data) {
	config := new(ClusterConfig)
	if err := json.Unmarshal(data.Value, config); err != nil {
		logrus.Error(err)
		return
	}

	f(config)
}
270571
func (c *Command) addHelpGroup(showHelp func() error) *Group {
	// Windows CLI applications typically use /? for help, so make both
	// that available as well as the POSIX style h and help.
	var help struct {
		ShowHelpWindows func() error `short:"?" description:"Show this help message"`
		ShowHelpPosix   func() error `short:"h" long:"help" description:"Show this help message"`
	}

	help.ShowHelpWindows = showHelp
	help.ShowHelpPosix = showHelp

	ret, _ := c.AddGroup("Help Options", "", &help)
	ret.isBuiltinHelp = true

	return ret
}
960416
func (client *Client) AddDomainGroup(args *AddDomainGroupArgs) (response *AddDomainGroupResponse, err error) {
	action := "AddDomainGroup"
	response = &AddDomainGroupResponse{}
	err = client.Invoke(action, args, response)
	if err == nil {
		return response, nil
	} else {
		log.Printf("%s error, %v", action, err)
		return response, err
	}
}
606787
func (g *GroupOperations) Add(connectionID string) {
	g.e.addToGroup(g.group, connectionID)
}
1324519
func (c *Compiler) SetIncludeCallback(cb CompilerIncludeFunc) {
	if cb == nil {
		c.DisableIncludes()
		return
	}
	id := callbackData.Put(cb)
	c.setCallbackData(id)
	C.yr_compiler_set_include_callback(
		c.compiler.cptr,
		C.YR_COMPILER_INCLUDE_CALLBACK_FUNC(C.includeCallback),
		C.YR_COMPILER_INCLUDE_FREE_FUNC(C.freeCallback),
		id,
	)
	keepAlive(c)
	return
}
668958
func (c *Chain) AddNodeGroup(groups ...*NodeGroup) {
	if c == nil {
		return
	}
	for _, group := range groups {
		c.nodeGroups = append(c.nodeGroups, group)
	}
}
890919
func (c *Cache) addItemToGroups(itmKey string, groupIDs []string) {
	for _, grpID := range groupIDs {
		if _, has := c.groups[grpID]; !has {
			c.groups[grpID] = make(map[string]struct{})
		}
		c.groups[grpID][itmKey] = struct{}{}
	}
}
1012085
func (bto *BootstrapTokenOptions) AddGroupsFlag(fs *pflag.FlagSet) {
	fs.StringSliceVar(
		&bto.Groups, TokenGroups, bto.Groups,
		fmt.Sprintf("Extra groups that this token will authenticate as when used for authentication. Must match %q", bootstrapapi.BootstrapGroupPattern),
	)
}
1290796
func (p *parser) addGroup() error {
	if p.group.t == ntTestgroup || p.group.t == ntTestref {
		p.group.addChild(p.concatenation.reverseLeft())
		if (p.group.t == ntTestref && len(p.group.children) > 2) || len(p.group.children) > 3 {
			return p.getErr(ErrTooManyAlternates)
		}
	} else {
		p.alternation.addChild(p.concatenation.reverseLeft())
		p.group.addChild(p.alternation)
	}

	p.unit = p.group
	return nil
}
56820
func (f *StringForwarder) invokeCallback(callback func(string), msg string) {
	f.mu.Unlock()
	defer f.mu.Lock()
	callback(msg)
}