Send given message, and return a future
12653
def send(self, msg, timeout=None, callback=None, raw=False):
        '''
        
        '''
        message_id = self._message_id()
        header = {'mid': message_id}

        future = tornado.concurrent.Future()
        if callback is not None:
            def handle_future(future):
                response = future.result()
                self.io_loop.add_callback(callback, response)
            future.add_done_callback(handle_future)
        # Add this future to the mapping
        self.send_future_map[message_id] = future

        if self.opts.get('detect_mode') is True:
            timeout = 1

        if timeout is not None:
            send_timeout = self.io_loop.call_later(timeout, self.timeout_message, message_id)
            self.send_timeout_map[message_id] = send_timeout

        # if we don't have a send queue, we need to spawn the callback to do the sending
        if not self.send_queue:
            self.io_loop.spawn_callback(self._stream_send)
        self.send_queue.append((message_id, salt.transport.frame.frame_msg(msg, header=header)))
        return future
1032704
def SendVerack(self):
        """"""
        m = Message('verack')
        self.SendSerializedMessage(m)
        self.expect_verack_next = True
123486
async def send(self, clear=True, parse_mode=()):
        
        await self._client.send_message(
            self._peer, self.text, reply_to=self.reply_to_msg_id,
            link_preview=self.link_preview, parse_mode=parse_mode,
            clear_draft=clear
        )
642428
def finish(self, message: Optional[Message_T] = None, **kwargs) -> None:
        """"""
        if message:
            asyncio.ensure_future(self.send(message, **kwargs))
        raise _FinishException
677808
def submit(self, __fun, *args, **kwargs):
    

    future = Future().bind(__fun, *args, **kwargs)
    self.enqueue(future)
    return future
1033517
def sendResult(self, future):
        """"""
        # Greenlets cannot be pickled
        future.greenlet = None
        assert future._ended(), "The results are not valid"
        self.socket.sendResult(future)
384771
def _send(self, message):
        
        result = self._talk.put(message)
        if not result:
            self._logger.error('Failed to send "%s"' % message)
        return result
1068612
def write_message(
        self, message: Union[str, bytes], binary: bool = False
    ) -> "Future[None]":
        """"""
        if binary:
            opcode = 0x2
        else:
            opcode = 0x1
        message = tornado.escape.utf8(message)
        assert isinstance(message, bytes)
        self._message_bytes_out += len(message)
        flags = 0
        if self._compressor:
            message = self._compressor.compress(message)
            flags |= self.RSV1
        # For historical reasons, write methods in Tornado operate in a semi-synchronous
        # mode in which awaiting the Future they return is optional (But errors can
        # still be raised). This requires us to go through an awkward dance here
        # to transform the errors that may be returned while presenting the same
        # semi-synchronous interface.
        try:
            fut = self._write_frame(True, opcode, message, flags=flags)
        except StreamClosedError:
            raise WebSocketClosedError()

        async def wrapper() -> None:
            try:
                await fut
            except StreamClosedError:
                raise WebSocketClosedError()

        return asyncio.ensure_future(wrapper())
514067
def message(self, to, subject, text):
        """"""
        return self.compose(to, subject, text)
300844
function (message) {

            // forward the message to the local promise,
            // which will return a response promise
            var local = getLocal(message.to).promise;
            var response = local.dispatch(message.op, decode(message.args));
            var envelope;

            // connect the local response promise with the
            // remote response promise:

            // if the value is ever resolved, send the
            // fulfilled value across the wire
            response.then(function (resolution) {
                try {
                    resolution = encode(resolution);
                } catch (exception) {
                    try {
                        resolution = {"!": encode(exception)};
                    } catch (_exception) {
                        resolution = {"!": null};
                    }
                }
                envelope = JSON.stringify({
                    "type": "resolve",
                    "to": message.from,
                    "resolution": resolution
                });
                connection.put(envelope);
            }, function (reason) {
                try {
                    reason = encode(reason);
                } catch (exception) {
                    try {
                        reason = encode(exception);
                    } catch (_exception) {
                        reason = null;
                    }
                }
                envelope = JSON.stringify({
                    "type": "resolve",
                    "to": message.from,
                    "resolution": {"!": reason}
                });
                connection.put(envelope);
            }, function (progress) {
                try {
                    progress = encode(progress);
                    envelope = JSON.stringify({
                        "type": "notify",
                        "to": message.from,
                        "resolution": progress
                    });
                } catch (exception) {
                    try {
                        progress = {"!": encode(exception)};
                    } catch (_exception) {
                        progress = {"!": null};
                    }
                    envelope = JSON.stringify({
                        "type": "resolve",
                        "to": message.from,
                        "resolution": progress
                    });
                }
                connection.put(envelope);
            })
            .done();

        }
763525
def send(self, *args, **kwargs):
        """"""
        conn = SMTP(*args, **kwargs)
        send_result = conn.send(self)
        return conn, send_result
625295
async def send_message(
        self, request: str, response_expected: bool, **kwargs: Any
    ) -> Response:
        
        await self.socket.send(request)
        if response_expected:
            response_text = await self.socket.recv()
            return Response(response_text)
        return Response("")
21064
def return_future(fn):
    
    @wraps(fn)
    def decorated(*args, **kwargs):
        return gen.maybe_future(fn(*args, **kwargs))

    return decorated
544949
def send(self, data, **kws):
        """"""
        return yield_(Send(self, data, timeout=self._timeout, **kws))
491706
def send_message(self, *args, **kwargs):
        """"""
        return send_message(*args, **self._merge_overrides(**kwargs)).run()
878014
private ReceiveMessageFuture issueFuture(int size,
                                             QueueBufferCallback<ReceiveMessageRequest, ReceiveMessageResult> callback) {
        synchronized (futures) {
            ReceiveMessageFuture theFuture = new ReceiveMessageFuture(callback, size);
            futures.addLast(theFuture);
            return theFuture;
        }
    }
137562
def send_message(self, *args, **kwargs):
		''''''
		return super(MQBot, self).send_message(*args, **kwargs)