Sends and receives the result for the given request.
761241
async def send(self, request):
        
        body = bytes(request)
        msg_id = self._state._get_new_msg_id()
        await self._connection.send(
            struct.pack('<qqi', 0, msg_id, len(body)) + body
        )

        body = await self._connection.recv()
        if len(body) < 8:
            raise InvalidBufferError(body)

        with BinaryReader(body) as reader:
            auth_key_id = reader.read_long()
            assert auth_key_id == 0, 'Bad auth_key_id'

            msg_id = reader.read_long()
            assert msg_id != 0,  'Bad msg_id'
            # ^ We should make sure that the read ``msg_id`` is greater
            # than our own ``msg_id``. However, under some circumstances
            # (bad system clock/working behind proxies) this seems to not
            # be the case, which would cause endless assertion errors.

            length = reader.read_int()
            assert length > 0,  'Bad length'
            # We could read length bytes and use those in a new reader to read
            # the next TLObject without including the padding, but since the
            # reader isn't used for anything else after this, it's unnecessary.
            return reader.tgread_object()
200587
function (error) {
        send(channel, new MSG.OpenResult(msg.tcpId, Protocol.toOpenResultStatus(error), null, null));
      }
200893
async def send_request(self, method, args=()):
        ''''''
        message, event = self.connection.send_request(Request(method, args))
        return await self._send_concurrent(message, event, 1)
331212
public final void request(Result<I> result)
  {
    I instance = _instance;
    
    if (instance != null && _lifecycle.isActive() && ! isModified()) {
      result.ok(instance);
    }
    else if (_lifecycle.isDestroyed()) {
      result.ok(null);
    }
    else {
      _strategy.request(this, result);
    }
  }
940171
def send_result(pipe, data):
    """"""
    try:
        pipe.send(data)
    except (pickle.PicklingError, TypeError) as error:
        error.traceback = format_exc()
        pipe.send(RemoteException(error, error.traceback))
673808
def result(body, type)
      result = JSON.load(body)

      case type
      when 'api/send'
        body
      when 'api/status'
        body
      when 'api/cancel'
        body
      end

    end
899202
public void handleSuccess ()
    {
        if (_listener instanceof InvocationService.ConfirmListener) {
            reportRequestProcessed();
        } else if (_listener instanceof InvocationService.ResultListener && _resultSet) {
            reportRequestProcessed(_result);
        }
    }
1266000
public function sendResult($result)
    {
        if (@ob_get_length()) {
            @ob_end_clean();
        }
        if (isset($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'application/json') !== false) {
            header('Content-Type: application/json; charset=' . APP_CHARSET, true);
        } else {
            header('Content-Type: text/plain; charset=' . APP_CHARSET, true);
        }
        echo json_encode($result);
        die();
    }
216669
public void requestCompleted (T result)
    {
        if (_chain != null) {
            _chain.requestCompleted(result);

        } else if (_invChain instanceof InvocationService.ResultListener) {
            ((InvocationService.ResultListener)_invChain).requestProcessed(result);

        } else if (_invChain instanceof InvocationService.ConfirmListener) {
            ((InvocationService.ConfirmListener)_invChain).requestProcessed();
        }
    }
1269908
function (result) {
    // update status
    me.resolved = true;
    me.rejected = false;
    me.pending = false;

    _onSuccess.forEach(function (fn) {
      fn(result);
    });

    _process = function (onSuccess, onFail) {
      onSuccess(result);
    };

    _resolve = _reject = function () { };

    return me;
  }
76206
def req(self, method, params=()):
        """"""

        response = self.session.post(
            self.url,
            data=json.dumps({"method": method, "params": params, "jsonrpc": "1.1"}),
        ).json()

        if response["error"] is not None:
            return response["error"]
        else:
            return response["result"]
358790
def _send_request(self, request, **kwargs):
        """"""
        log.debug(LOG_CHECK, "Send request %s with %s", request, kwargs)
        log.debug(LOG_CHECK, "Request headers %s", request.headers)
        self.url_connection = self.session.send(request, **kwargs)
        self.headers = self.url_connection.headers
        self._add_ssl_info()
448072
def handle_request(self):
        """"""
        try:
            request, client_address = self.get_request()
        except socket.error:
            return

        if self.verify_request(request, client_address):
            self.requests.put((request, client_address))
387612
protected void sendRequests() {
        if ( ! requestUnderway ) {
            requestUnderway = true;
            delayed( new Runnable() {
                @Override
                public void run() {
                    synchronized (requests) {
                        Object req[];
                        if ( openFutureRequests.get() > 0 && requests.size() == 0 ) {
                            req = new Object[] { "SP", lastSeenSeq };
                        } else {
                            req = new Object[requests.size() + 1];
                            for (int i = 0; i < requests.size(); i++) {
                                req[i] = requests.get(i);
                            }
                            req[req.length - 1] = lastSeenSeq;
                            requests.clear();
                        }

                        sendCallArray(req).then(new Callback<Integer>() {
                            @Override
                            public void receive(Integer result, Object error) {
                                synchronized (requests ) {
                                    requestUnderway = false;
                                    if ( requests.size() > 0 || (result != null && result > 0 && openFutureRequests.get() > 0 ) ) {
                                        myExec.execute(new Runnable() {
                                            @Override
                                            public void run() {
                                            sendRequests();
                                            }
                                        });
                                    }
                                }
                            }
                        });
                    }
                }
            }, 1);
        }
    }
1013575
async def send(self, request: Request[HTTPRequestType], **config: Any) -> Response[HTTPRequestType, AsyncHTTPResponseType]:
        
        pass
308371
def send_result(self, additional_dict):
        '''
        
        '''
        self.send_response(200)
        self.send_header("Content-type", "application/json")
        response = {
            'jsonrpc': self.req_rpc_version,
            'id': self.req_id,
        }
        response.update(additional_dict)
        jresponse = json.dumps(response)
        self.send_header("Content-length", len(jresponse))
        self.end_headers()
        self.wfile.write(jresponse.encode())
1033517
def sendResult(self, future):
        """"""
        # Greenlets cannot be pickled
        future.greenlet = None
        assert future._ended(), "The results are not valid"
        self.socket.sendResult(future)