// Respond sends a GossipMessage to the origin from which this ReceivedMessage was sent from
510717
func (packet *packetMock) Respond(msg *proto.GossipMessage) {
	sMsg, _ := msg.NoopSign()
	packet.src.socket <- &packetMock{
		src: packet.dst,
		dst: packet.src,
		msg: sMsg,
	}
}
26529
func (s *GroupsService) Replies(channel string, threadTimestamp string) *GroupsRepliesCall {
	var call GroupsRepliesCall
	call.service = s
	call.channel = channel
	call.threadTimestamp = threadTimestamp
	return &call
}
1155149
func (r *SetxattrRequest) Respond() {
	out := &outHeader{Unique: uint64(r.ID)}
	r.Conn.respond(out, unsafe.Sizeof(*out))
}
204504
func (r *BeeResponse) Send(response *restful.Response) {
	var keys []string
	for k := range r.bees {
		keys = append(keys, k)
	}
	sort.Strings(keys)

	for _, k := range keys {
		r.Bees = append(r.Bees, prepareBeeResponse(r.Context, r.bees[k]))
	}

	r.Response.Send(response)
}
1199682
func (r *ReadRequest) Respond(resp *ReadResponse) {
	out := &outHeader{Unique: uint64(r.ID)}
	r.Conn.respondData(out, unsafe.Sizeof(*out), resp.Data)
}
666195
func (g *gossipServiceImpl) Send(msg *proto.GossipMessage, peers ...*comm.RemotePeer) {
	m, err := msg.NoopSign()
	if err != nil {
		g.logger.Warningf("Failed creating SignedGossipMessage: %+v", errors.WithStack(err))
		return
	}
	g.comm.Send(m, peers...)
}
539659
func (b *Bot) Respond(callback *Callback, responseOptional ...*CallbackResponse) error {
	var response *CallbackResponse
	if responseOptional == nil {
		response = &CallbackResponse{}
	} else {
		response = responseOptional[0]
	}

	response.CallbackID = callback.ID
	respJSON, err := b.Raw("answerCallbackQuery", response)
	if err != nil {
		return err
	}

	return extractOkResponse(respJSON)
}
891193
func (c *UDPClient) Send(message *proto.Msg) (*proto.Msg, error) {
	responseCh := make(chan response)
	c.requestQueue <- request{message, responseCh}
	r := <-responseCh
	return r.message, r.err
}
147694
func (r *CreateRequest) Respond(resp *CreateResponse) {
	eSize := entryOutSize(r.Header.Conn.proto)
	buf := newBuffer(eSize + unsafe.Sizeof(openOut{}))

	e := (*entryOut)(buf.alloc(eSize))
	e.Nodeid = uint64(resp.Node)
	e.Generation = resp.Generation
	e.EntryValid = uint64(resp.EntryValid / time.Second)
	e.EntryValidNsec = uint32(resp.EntryValid % time.Second / time.Nanosecond)
	e.AttrValid = uint64(resp.Attr.Valid / time.Second)
	e.AttrValidNsec = uint32(resp.Attr.Valid % time.Second / time.Nanosecond)
	resp.Attr.attr(&e.Attr, r.Header.Conn.proto)

	o := (*openOut)(buf.alloc(unsafe.Sizeof(openOut{})))
	o.Fh = uint64(resp.Handle)
	o.OpenFlags = uint32(resp.Flags)

	r.respond(buf)
}
184872
func (r *GetattrRequest) Respond(resp *GetattrResponse) {
	size := attrOutSize(r.Header.Conn.proto)
	buf := newBuffer(size)
	out := (*attrOut)(buf.alloc(size))
	out.AttrValid = uint64(resp.Attr.Valid / time.Second)
	out.AttrValidNsec = uint32(resp.Attr.Valid % time.Second / time.Nanosecond)
	resp.Attr.attr(&out.Attr, r.Header.Conn.proto)
	r.respond(buf)
}
728970
func (service *Service) Send(ctx context.Context, code int, body interface{}) error {
	r := ContextResponse(ctx)
	if r == nil {
		return fmt.Errorf("no response data in context")
	}
	r.WriteHeader(code)
	return service.EncodeResponse(ctx, body)
}
125288
func (r *GetxattrRequest) Respond(resp *GetxattrResponse) {
	if r.Size == 0 {
		buf := newBuffer(unsafe.Sizeof(getxattrOut{}))
		out := (*getxattrOut)(buf.alloc(unsafe.Sizeof(getxattrOut{})))
		out.Size = uint32(len(resp.Xattr))
		r.respond(buf)
	} else {
		buf := newBuffer(uintptr(len(resp.Xattr)))
		buf = append(buf, resp.Xattr...)
		r.respond(buf)
	}
}
266123
func (s *Service) Send(ctx context.Context, msg Message) {
	go func(ctx context.Context, msg Message) {
		setCurrentIdentity(ctx, &msg)

		u, err := url.Parse(s.config.GetNotificationServiceURL())
		if err != nil {
			log.Error(ctx, map[string]interface{}{
				"url": s.config.GetNotificationServiceURL(),
				"err": err,
			}, "unable to parse GetNotificationServiceURL")
		}

		cl := client.New(goaclient.HTTPClientDoer(http.DefaultClient))
		cl.Host = u.Host
		cl.Scheme = u.Scheme
		cl.SetJWTSigner(goasupport.NewForwardSigner(ctx))

		msgID := goauuid.UUID(msg.MessageID)

		resp, err := cl.SendNotify(
			goasupport.ForwardContextRequestID(ctx),
			client.SendNotifyPath(),
			&client.SendNotifyPayload{
				Data: &client.Notification{
					Type: "notifications",
					ID:   &msgID,
					Attributes: &client.NotificationAttributes{
						Type:   msg.MessageType,
						ID:     msg.TargetID,
						Custom: msg.Custom,
					},
				},
			},
		)
		if err != nil {
			log.Error(ctx, map[string]interface{}{
				"message_id": msg.MessageID,
				"type":       msg.MessageType,
				"target_id":  msg.TargetID,
				"err":        err,
			}, "unable to send notification")
		} else if resp.StatusCode >= 400 {
			log.Error(ctx, map[string]interface{}{
				"status":     resp.StatusCode,
				"message_id": msg.MessageID,
				"type":       msg.MessageType,
				"target_id":  msg.TargetID,
				"err":        err,
			}, "unexpected response code")
		}
		defer rest.CloseResponse(resp)

	}(ctx, msg)
}
728342
func (r *InitRequest) Respond(resp *InitResponse) {
	buf := newBuffer(unsafe.Sizeof(initOut{}))
	out := (*initOut)(buf.alloc(unsafe.Sizeof(initOut{})))
	out.Major = resp.Library.Major
	out.Minor = resp.Library.Minor
	out.MaxReadahead = resp.MaxReadahead
	out.Flags = uint32(resp.Flags)
	out.MaxWrite = resp.MaxWrite

	// MaxWrite larger than our receive buffer would just lead to
	// errors on large writes.
	if out.MaxWrite > maxWrite {
		out.MaxWrite = maxWrite
	}
	r.respond(buf)
}
539113
func (s *InMemorySender) Send(msg message.Composer) {
	if !s.Level().ShouldLog(msg) {
		return
	}

	s.mutex.Lock()
	defer s.mutex.Unlock()

	if len(s.buffer) < cap(s.buffer) {
		s.buffer = append(s.buffer, msg)
	} else {
		s.buffer[s.head] = msg
	}
	s.head = (s.head + 1) % cap(s.buffer)

	s.totalBytesSent += int64(len(msg.String()))
}
920793
func (res *Response) Send(strings ...string) error {
	if err := res.Robot.Adapter.Send(res, strings...); err != nil {
		Logger.Error(err)
		return err
	}
	return nil
}
1086606
func (c claim) respond(err error) {
	select {
	case <-c.stop:
	case c.response <- err:
	}
}