// Trigger will trigger the context action in the context of the server.
772268
func (c *ContextAction) Trigger() {
	packet := MumbleProto.ContextAction{
		Action: &c.Name,
	}
	c.client.Conn.WriteProto(&packet)
}
913937
func (c *ContextAction) TriggerUser(user *User) {
	packet := MumbleProto.ContextAction{
		Session: &user.Session,
		Action:  &c.Name,
	}
	c.client.Conn.WriteProto(&packet)
}
984996
func trigger(phase string, stack []plugin.Plugin, ctx *c.Context) *c.Context {
	var wg sync.WaitGroup
	wg.Add(1)

	// Finisher function
	done := func(_ctx *c.Context) {
		ctx = _ctx
		wg.Done()
	}

	i := len(stack)
	if i == 0 {
		wg.Done()
		return ctx
	}

	next := done
	for i > 0 {
		i--
		next = nextHandler(phase, stack[i], next, done)
	}

	// Exposes current middleware phase via context
	ctx.Set("$phase", phase)

	// Triggers the middleware call chain
	next(ctx)

	wg.Wait()
	return ctx
}
959402
func (c *GroupRequestsVersionsRollupCall) Context(ctx context.Context) *GroupRequestsVersionsRollupCall {
	c.ctx_ = ctx
	return c
}
931
func (c *ServerGetBotConfigCall) Context(ctx context.Context) *ServerGetBotConfigCall {
	c.ctx_ = ctx
	return c
}
1254224
func Trigger(trigger string, args ...interface{}) {
	tl.Lock()
	priorities, exists := triggers[trigger]
	tl.Unlock()

	if exists {
		for p := 0; p <= 100; p++ {
			for _, f := range priorities[p] {
				params := make([]reflect.Value, len(args))
				for idx := range args {
					params[idx] = reflect.ValueOf(args[idx])
				}
				reflect.ValueOf(f).Call(params)
			}
		}
	}

	// fire off subscriptions for all events
	if trigger != "*" {
		Trigger("*", args...)
	}
}
1174854
func (m *Memberlist) triggerFunc(stagger time.Duration, C <-chan time.Time, stop <-chan struct{}, f func()) {
	// Use a random stagger to avoid syncronizing
	randStagger := time.Duration(uint64(rand.Int63()) % uint64(stagger))
	select {
	case <-time.After(randStagger):
	case <-stop:
		return
	}
	for {
		select {
		case <-C:
			f()
		case <-stop:
			return
		}
	}
}
1306811
func (c *FailCall) Context(ctx context.Context) *FailCall {
	c.ctx_ = ctx
	return c
}
1282844
func (c *GroupListCall) Context(ctx context.Context) *GroupListCall {
	c.ctx_ = ctx
	return c
}
1164250
func (c *UpstreamUpdateCall) Context(ctx context.Context) *UpstreamUpdateCall {
	c.ctx_ = ctx
	return c
}
1226534
func (i *VarAdder) Generate(next ContextHandler) ContextHandler {
	return HandlerFunc(func(ctx context.Context, rw http.ResponseWriter, r *http.Request) {
		next.ServeHTTPC(context.WithValue(ctx, i.Key, i.Value), rw, r)
	})
}
724608
func (c *UtilUuidCall) Context(ctx context.Context) *UtilUuidCall {
	c.ctx_ = ctx
	return c
}
501422
func HandleContext(ctx context.Context, handler Handler) {
	format, _ := os.LookupEnv("FN_FORMAT")
	if format != "" && format != "http-stream" {
		log.Fatal("only http-stream format is supported, please set function.format=http-stream against your fn service")
	}
	path := os.Getenv("FN_LISTENER")
	startHTTPServer(ctx, handler, path)
}
558523
func (b *Backend) TriggerChord(groupUUID string) (bool, error) {
	query := bson.M{
		"_id":             groupUUID,
		"chord_triggered": false,
	}
	change := bson.M{
		"$set": bson.M{
			"chord_triggered": true,
		},
	}

	_, err := b.groupMetasCollection.UpdateOne(context.Background(), query, change, options.Update())

	if err != nil {
		if err == mongo.ErrNoDocuments {
			log.WARNING.Printf("Chord already triggered for group %s", groupUUID)
			return false, nil
		}
		return false, err
	}
	return true, nil
}
971029
func (r *Request) Context(ctx context.Context) *Request {
	r.ctx = ctx
	return r
}
458037
func ContextAction(ctx context.Context) string {
	if a := ctx.Value(actionKey); a != nil {
		return a.(string)
	}
	return "<unknown>"
}
324875
func (c *Client) Trigger(event string, v interface{}) (*http.Response, error) {
	b := new(bytes.Buffer)

	switch v := v.(type) {
	case io.Reader:
		if _, err := io.Copy(b, v); err != nil {
			return nil, err
		}
	default:
		if err := json.NewEncoder(b).Encode(v); err != nil {
			return nil, err
		}
	}

	req, err := http.NewRequest("POST", c.URL, b)
	if err != nil {
		return nil, err
	}

	req.Header.Set("X-GitHub-Event", event)
	req.Header.Set("X-Hub-Signature", fmt.Sprintf("sha1=%s", hookshot.Signature(b.Bytes(), c.Secret)))

	return c.Do(req)
}