// Register registers the supplied NotificationHandler to recieve OVSDB Notifications
421114
func (ovs *OvsdbClient) Register(handler NotificationHandler) {
	ovs.handlersMutex.Lock()
	defer ovs.handlersMutex.Unlock()
	ovs.handlers = append(ovs.handlers, handler)
}
967846
func (d *dispatcher) Register(c StreamType, h Handler) {
	d.handlers[c] = h
}
34896
func (c *Consumer) Register(topic, channel string, maxInFlight int, handler Handler) error {
	tch := topicChan{topic, channel}

	var config *nsq.Config
	if c.Config == nil {
		config = nsq.NewConfig()
		config.Set("verbose", DefaultVerbose)
		config.Set("max_in_flight", maxInFlight)
	} else {
		config = c.Config
	}

	r, err := nsq.NewConsumer(topic, channel, config)
	if err != nil {
		return err
	}

	r.SetLogger(c.Logger, c.LogLevel)

	q := &queue{handler, r}
	r.AddConcurrentHandlers(q, maxInFlight)
	c.handlers[tch] = q
	return nil
}
1081269
func Register(name string, log loggerType) {
	if log == nil {
		panic("logs: Register provide is nil")
	}
	// if _, dup := adapters[name]; dup {
	// 	panic("logs: Register called twice for provider " + name)
	// }
	adapters[name] = log
}
1167504
func Register(trigger string, args ...interface{}) {
	tl.Lock()
	defer tl.Unlock()

	var f interface{}
	var priority int

	if len(args) >= 2 {
		priority, _ = args[0].(int)
		f = args[1]
	} else {
		priority = 0
		f = args[0]
	}

	str := args[len(args)-1]

	// if the last element you pass in is a string, and not a function, then lets default to exec
	if _, isString := str.(string); isString {
		f = func(i interface{}) {
			payload, err := json.Marshal(i)
			if err != nil {
				return
			}

			in := bytes.NewReader(payload)
			cmd := exec.Command("bash", "-c", str.(string))
			cmd.Stdin = in

			if results, err := cmd.Output(); err == nil {
				json.Unmarshal(results, &i)
			}
		}
	}

	_, exists := triggers[trigger]
	if !exists {
		triggers[trigger] = make(map[int][]interface{})
		for p := 0; p <= 100; p++ {
			triggers[trigger][p] = make([]interface{}, 0)
		}
	}
	triggers[trigger][priority] = append(triggers[trigger][priority], f)
}
589005
func Register(id string, rf DynamicStatusRetriever) {
	monitor.RLock()
	defer monitor.RUnlock()
	monitor.backend().Register(id, rf)
}
1154785
func (c *Config) registerHandler(h plugin.Handler) {
	if c.registry == nil {
		c.registry = make(map[string]plugin.Handler)
	}

	// Just overwrite...
	c.registry[h.Name()] = h
}
30633
func Register(pvLister PVLister, pvcLister PVCLister) {
	registerMetrics.Do(func() {
		prometheus.MustRegister(newPVAndPVCCountCollector(pvLister, pvcLister))
		prometheus.MustRegister(volumeOperationMetric)
		prometheus.MustRegister(volumeOperationErrorsMetric)
	})
}
861965
func (a *Wrapper) Register(p string, h interface{}, methods ...string) *Wrapper {
	if len(methods) < 1 {
		methods = append(methods, "GET")
	}
	_, ctl, act := a.Module.Application.URLBuilder.Set(h)
	a.Module.Router().Match(methods, p, NewHandler(a.wrapHandler(h, ctl, act), a.HandlerName(h)))
	return a
}
561520
func (i *interruptListener) Register(cb func()) {
	if cb == nil {
		return
	}

	i.listenOnce()
	i.mu.Lock()
	i.onInterrupt = append(i.onInterrupt, cb)
	i.mu.Unlock()
}
157748
func (m *Machine) RegisterNotifier(services ...NotificationService) {
	for _, service := range services {
		m.notifiers = append(m.notifiers, service)
	}
}
1200053
func (tc *Consumer) RegisterCustomHandler(key string, handler func([]byte) (*Response, error)) {
	tc.customHandlers[key] = handler
}
708591
func (c *Client) Register(event NotifyCategory) error {
	if event == ChannelEvents {
		return c.RegisterChannel(0)
	}

	_, err := c.ExecCmd(NewCmd("servernotifyregister").WithArgs(
		NewArg("event", event),
	))
	return err
}
1032723
func (s *Server) Register(api API) {
	uri := api.URI()
	if len(uri) == 0 {
		panic("URI() return empty string")
	}
	if uri[0] != '/' {
		uri = "/" + uri
	}
	log.Infof("New api handler, uri=%s", uri)

	// raw http handler
	if handler, ok := api.(http.Handler); ok {
		s.Get("/v2"+uri, handler.ServeHTTP)
		return
	}
	s.Get(
		"/v2"+uri,
		func(w http.ResponseWriter, r *http.Request, es *EventSource, ctx context.Context) {
			if GetBool(r, "watch", false) {
				handleWatch(api, w, r, es, ctx)
			} else {
				handleGet(api, w, r, ctx)
			}
		},
	)
}
258627
func Register(r interface{}, collectors ...func() (statKey string, stats interface{})) error {
	return doReg(r, collectors, true, true)
}
790483
func (p *Plugin) Register(name interface{}, listener func(Status)) {
	p.mtx.Lock()
	defer p.mtx.Unlock()

	if p.listeners == nil {
		p.listeners = map[interface{}]func(Status){}
	}

	p.listeners[name] = listener
}
77698
func (cli *Client) Register(req *ReqRegister) (*RespRegister, *RespUserInteractive, error) {
	u := cli.BuildURL("register")
	return cli.register(u, req)
}