Transfert a message to everybody
772193
def on_chat(self, data):
        '''  '''
        # XXX: we cannot use on_message as it's 'official' one already used
        # by sockjsroom to create multiple on_* elements (like on_chat),
        # so we use on_chat instead of on_message

        # data => message
        if self.roomId != '-1':
            self.publishToRoom(self.roomId, 'chat', {
                'username': self.username,
                'time': datetime.now(),
                'message': str(data['message'])
            })
401373
def send_simple_to_all(title, content)
      result = []
      [@android, @ios].each do |sender|
        result << sender.pushToAllDevice(title,content)
      end
      result
    end
254066
def mass_send_message(self, msg):
        
        for stream in self._connections.keys():
            if not stream.closed():
                # Don't cause noise by trying to write to already closed streams
                self.send_message(stream, msg)
1006715
def publish(self, message):
        
        props = pika.BasicProperties(content_type='text/plain', delivery_mode=1)
        self.channel.basic_publish(self._exchange,
                                   self._routing_key,
                                   message,
                                   props)
1032814
def send_message(message, params, site, logger):
    """"""
    client.capture(
        'Message',
        message=message,
        params=tuple(params),
        data={
            'site': site,
            'logger': logger,
        },
    )
65237
def send(self, sock, msg):
    """"""
    data = pickle.dumps(msg)
    buf = struct.pack('>I', len(data)) + data
    sock.sendall(buf)
938990
def _send(self, messages):
        """"""
        if len(messages) == 1:
            to_send = self._build_message(messages[0])
            if to_send is False:
                # The message was missing recipients.
                # Bail.
                return False
        else:
            pm_messages = list(map(self._build_message, messages))
            pm_messages = [m for m in pm_messages if m]
            if len(pm_messages) == 0:
                # If after filtering, there aren't any messages
                # to send, bail.
                return False
            to_send = PMBatchMail(messages=pm_messages)
        try:
            to_send.send(test=self.test_mode)
        except:
            if self.fail_silently:
                return False
            raise
        return True
402762
function sendMessage(command, opt_value, opt_transfer) {
    // TODO(benvanik): attempt to use webkitPostMessage
    originalPostMessage.call(goog.global, {
      '__wtf_worker_msg__': true,
      'command': command,
      'value': opt_value || null
    }, []);
  }
204487
def send(self, msg_dict):
        """"""
        message = ejson.dumps(msg_dict)
        super(DDPSocket, self).send(message)
        self._debug_log('<<<{}'.format(message))
732354
def send_messages(self, messages):
        """"""
        msg_count = 0
        for message in messages:  # .message() triggers header validation
            message.message()
            email.outbox.append(message)
            msg_count += 1

        return msg_count
1262867
function sendMessages(ID, messageArr, interval) {
	var resArr = [], len = messageArr.length;
	var callback = typeof(arguments[2]) === 'function' ?  arguments[2] :  arguments[3];
	if (typeof(interval) !== 'number') interval = 1000;

	function _sendMessages() {
		setTimeout(function() {
			if (messageArr[0]) {
				bot.sendMessage({
					to: ID,
					message: messageArr.shift()
				}, function(err, res) {
					resArr.push(err || res);
					if (resArr.length === len) if (typeof(callback) === 'function') callback(resArr);
				});
				_sendMessages();
			}
		}, interval);
	}
	_sendMessages();
}
91990
private void sendInternal(long destHSId, VoltMessage message)
    {
        message.m_sourceHSId = getHSId();
        m_messenger.send(destHSId, message);
    }
332894
function sendMessage( ws, type, content )
{
	let sMessage	= JSON.stringify([type, content]);
	if ( ws.readyState !== ws.OPEN )
	{
		return console.log( "readyState=" + ws.readyState + ' on peer ' + ws.peer + ', will not send ' + sMessage );
	}

	//	...
	console.log( "SENDING " + sMessage + " to " + ws.peer );
	ws.send( sMessage );
}
215569
function share() {
    var status = $.trim($('#status').val()),
        target = $('#target').val();

    // Nothing to share
    if(status === '') {
      return;
    }

    // When messaging an individual user, update the target to be the user
    // that is being messaged.
    if(target === 'user') {
      target = $('#target_user').val();
    }

    // Dispatch the message to the server.
    socket.emit('post', status, target);

    // Clear the status input for the next message.
    $('#status').val('');
  }
918638
def send(self):
        
        parse_links = self.parse_links or self.parse_markdown_links

        message = {
            'annotations': [],
            'entities': {
                'parse_links': parse_links,
                'parse_markdown_links': self.parse_markdown_links,
            }
        }

        if self.photo:
            photo, photo_meta = _upload_file(self.api, self.photo)
            message['annotations'].append({
                'type': 'net.app.core.oembed',
                'value': {
                    '+net.app.core.file': {
                        'file_id': photo.id,
                        'file_token': photo.file_token,
                        'format': 'oembed',
                    }
                }
            })

        if self.attachment:
            attachment, attachment_meta = _upload_file(self.api, self.attachment)
            message['annotations'].append({
                'type': 'net.app.core.attachments',
                'value': {
                    '+net.app.core.file_list': [
                        {
                            'file_id': attachment.id,
                            'file_token': attachment.file_token,
                            'format': 'metadata',
                        }
                    ]
                }
            })

        if self.text:
            message['text'] = self.text
        else:
            message['machine_only'] = True

        if self.headline:
            message['annotations'].append({
                'type': 'net.app.core.broadcast.message.metadata',
                'value': {
                    'subject': self.headline,
                },
            })

        if self.read_more_link:
            message['annotations'].append({
                'type': 'net.app.core.crosspost',
                'value': {
                    'canonical_url': self.read_more_link,
                }
            })

        return self.api.create_message(self.channel_id, data=message)
296785
def broadcast(cls, message):
        
        clients = cls.get_clients()
        # loop over every client and send message
        for id, client in clients.iteritems():
            client.send_message(message)
834596
def send(self, msg):
        """"""
        debug('sent %s', msg)
        self.loop.send(self._packer.pack(msg))