// SendMessage posts a message synchronously.
971112
func (c *InternalClient) SendMessage(ctx context.Context, uri *pilosa.URI, msg []byte) error {
	span, ctx := tracing.StartSpanFromContext(ctx, "InternalClient.SendMessage")
	defer span.Finish()

	u := uriPathToURL(uri, "/internal/cluster/message")
	req, err := http.NewRequest("POST", u.String(), bytes.NewReader(msg))
	if err != nil {
		return errors.Wrap(err, "making new request")
	}
	req.Header.Set("Content-Type", "application/x-protobuf")
	req.Header.Set("User-Agent", "pilosa/"+pilosa.Version)
	req.Header.Set("Accept", "application/json")

	// Execute request.
	resp, err := c.executeRequest(req.WithContext(ctx))
	if err != nil {
		return errors.Wrap(err, "executing request")
	}
	return errors.Wrap(resp.Body.Close(), "closing response body")
}
692382
func (s *Event) SetMessage(v string) *Event {
	s.Message = &v
	return s
}
710415
func (c *EchoClient) SendMsg(msg string) error {
	return c.conn.Write(msg)
}
202555
func (soc *Socket) SendMessage(parts ...interface{}) (total int, err error) {
	return soc.sendMessage(0, parts...)
}
673446
func (rtm *Client) SendMessage(m *Message) error {
	rtm.socketLock.RLock()
	defer rtm.socketLock.RUnlock()

	if rtm.socketConnection == nil {
		return exception.New("Connection is closed.")
	}

	return rtm.socketConnection.WriteJSON(m)
}
538537
func (client *Client) ReplyMessage(replyToken string, messages ...SendingMessage) *ReplyMessageCall {
	return &ReplyMessageCall{
		c:          client,
		replyToken: replyToken,
		messages:   messages,
	}
}
779991
func (a *customAdapter) sendMessage(ctx *customAdapterWorkerContext, req interface{}) error {
	b, err := json.Marshal(req)
	if err != nil {
		return err
	}
	a.Trace("xfer: Custom adapter worker %d sending message: %v", ctx.workerNum, string(b))
	// Line oriented JSON
	b = append(b, '\n')
	_, err = ctx.stdin.Write(b)
	return err
}
1225052
func (s *ImageBuilderStateChangeReason) SetMessage(v string) *ImageBuilderStateChangeReason {
	s.Message = &v
	return s
}
769731
func (c *Client) SendMessages(m []models.Message, handler func(ack string) error) error {
	_, err := c.conn.SendRequest("msg.send", m, func(ctx *neptulon.ResCtx) error {
		var ack string
		if err := ctx.Result(&ack); err != nil {
			return fmt.Errorf("client: msg.send: error reading response: %v", err)
		}
		return handler(ack)
	})

	if err != nil {
		return fmt.Errorf("client: msg.send: error sending request: %v", err)
	}

	return nil
}
851890
func (s *SendEmailInput) SetMessage(v *Message) *SendEmailInput {
	s.Message = v
	return s
}
545176
func (c *Client) sendMessage(marshalledJSON []byte) {
	// Don't send the message if disconnected.
	select {
	case c.sendChan <- marshalledJSON:
	case <-c.disconnectChan():
		return
	}
}
1144116
func sendMessage(producer *client.AsyncProducer, msg utils.Message) error {
	var (
		msgKey   []byte
		msgMeta  []byte
		msgValue []byte
	)

	// init message
	if msg.Key != "" {
		msgKey = []byte(msg.Key)
	}
	if msg.Metadata != "" {
		msgMeta = []byte(msg.Metadata)
	}
	msgValue = []byte(msg.Text)

	// send message
	producer.SendMsgByte(msg.Topic, msgKey, msgValue, msgMeta)

	fmt.Println("message sent")
	return nil
}
652380
func (s *TestIdentityProviderOutput) SetMessage(v string) *TestIdentityProviderOutput {
	s.Message = &v
	return s
}
1263690
func (bot TgBot) SendMessage(cid int, text string, parsemode *ParseModeT, dwp *bool, rtmid *int, rm *ReplyMarkupInt) ResultWithMessage {
	var pm *string = nil
	if parsemode != nil {
		pmt := parsemode.String()
		pm = &pmt
	}
	payload := QuerySendMessage{cid, text, pm, dwp, rtmid, rm}
	return bot.SendMessageQuery(payload)
}
1213600
func (s *EnvironmentInfoDescription) SetMessage(v string) *EnvironmentInfoDescription {
	s.Message = &v
	return s
}
254480
func (w *Window) SendMessage(message interface{}, callbacks ...CallbackMessage) (err error) {
	if err = w.isActionable(); err != nil {
		return
	}
	var e = Event{Message: newEventMessage(message), Name: eventNameWindowCmdMessage, TargetID: w.id}
	if len(callbacks) > 0 {
		e.CallbackID = w.callbackIdentifier.new()
		w.On(eventNameWindowEventMessageCallback, func(i Event) (deleteListener bool) {
			if i.CallbackID == e.CallbackID {
				for _, c := range callbacks {
					c(i.Message)
				}
				deleteListener = true
			}
			return
		})
	}
	return w.w.write(e)
}
1001409
func (s *GetConnectivityInfoOutput) SetMessage(v string) *GetConnectivityInfoOutput {
	s.Message = &v
	return s
}