Sends a request to an SQS queue -- to be later popped off
        later for submission into Sentry.
        Note: This will simply raise any Boto ClientErrors that are encountered.
165397
def send(self, url, data, headers):
        
        if not self.queue_url:
            self.queue_url = self.sqs_client.get_queue_url(QueueName=self.sqs_name,
                                                           QueueOwnerAWSAccountId=self.sqs_account)["QueueUrl"]

        payload = {
            "url": url,
            "headers": headers,
            "data": base64.b64encode(data).decode("utf-8")
        }

        try:
            self.sqs_client.send_message(QueueUrl=self.queue_url,
                                         MessageBody=json.dumps(payload))
        except ClientError as e:
            # TODO break circular dep for logging
            print(data)  # not sure if this is the best way to get messages.
            raise e
42050
def post(self, request, bot_id, format=None):
        
        return super(HandlerList, self).post(request, bot_id, format)
1204563
def send_request(ref, msg_id, arg, b)
      @msg.send_request(stream, ref, msg_id, arg, b)
    end
826255
def request(self, *args, **kwargs):
        
        return RequestsHandler(*args, api_token=self.api_token,
                               verify=self.mist_client.verify,
                               job_id=self.mist_client.job_id, **kwargs)
976423
public void setRemoteQueue(InvocationRequestQueue remoteQueue) {
        this.remoteQueue = remoteQueue;
        InvocationRequest deferredRequest = helpRequest;
        sendRequest(loadRequest, false);
        sendRequest(deferredRequest, false);
    }
1344814
def send_request(req=None, method=None, requires_response=True):
    """"""
    if req is None:
        return functools.partial(send_request, method=method,
                                 requires_response=requires_response)

    @functools.wraps(req)
    def wrapper(self, *args, **kwargs):
        params = req(self, *args, **kwargs)
        _id = self.send(method, params, requires_response)
        return _id
    wrapper._sends = method
    return wrapper
889644
def send_request(self, api_name, *api_args, **api_kwargs):
        
        return self.conn.request(api_name, *api_args, **api_kwargs)
1136285
def _send_unary_request(self, request):
        
        if request.ack_ids:
            self._client.acknowledge(
                subscription=self._subscription, ack_ids=list(request.ack_ids)
            )

        if request.modify_deadline_ack_ids:
            # Send ack_ids with the same deadline seconds together.
            deadline_to_ack_ids = collections.defaultdict(list)

            for n, ack_id in enumerate(request.modify_deadline_ack_ids):
                deadline = request.modify_deadline_seconds[n]
                deadline_to_ack_ids[deadline].append(ack_id)

            for deadline, ack_ids in six.iteritems(deadline_to_ack_ids):
                self._client.modify_ack_deadline(
                    subscription=self._subscription,
                    ack_ids=ack_ids,
                    ack_deadline_seconds=deadline,
                )

        _LOGGER.debug("Sent request(s) over unary RPC.")
1098688
def _send_request(self, method, params=[], is_subscribe = False):
        '''
            
        '''
        # pick a new ID
        self.next_id += 1
        req_id = self.next_id

        # serialize as JSON
        msg = {'id': req_id, 'method': method, 'params': params}

        # subscriptions are a Q, normal requests are a future
        if is_subscribe:
            waitQ = asyncio.Queue()
            self.subscriptions[method].append(waitQ)

        fut = asyncio.Future(loop=self.loop)

        self.inflight[req_id] = (msg, fut)

        # send it via the transport, which serializes it
        if not self.protocol:
            logger.debug("Need to reconnect to server")

            async def connect_first():
                await self.reconnect()
                self.protocol.send_data(msg)

            self.loop.create_task(connect_first())
        else:
            # typical case, send request immediatedly, response is a future
            self.protocol.send_data(msg)

        return fut if not is_subscribe else (fut, waitQ)
900232
def resubmit(self, req, keyspace, req_d, retries):
        
        self.log('resubmitting %s request' % (req.method,))
        self.pushRequest_really(req, keyspace, req_d, retries)
        try:
            self.request_queue.pending.remove((req, keyspace, req_d, retries))
        except ValueError:
            # it's already been scooped up
            pass
        else:
            self.request_queue.pending.insert(0, (req, keyspace, req_d, retries))
582183
async def _ask_queue_update(self):
        
        try:
            while True:
                await asyncio.sleep(self._queue_update_timer)
                if self._queue_update_last_attempt == 0 or self._queue_update_last_attempt > self._queue_update_last_attempt_max:
                    if self._queue_update_last_attempt:
                        self._logger.error("Asking for a job queue update despite previous update not yet received")
                    else:
                        self._logger.debug("Asking for a job queue update")

                    self._queue_update_last_attempt = 1
                    await self._simple_send(ClientGetQueue())
                else:
                    self._logger.error("Not asking for a job queue update as previous update not yet received")
        except asyncio.CancelledError:
            return
        except KeyboardInterrupt:
            return
671196
async def send(bot: NoneBot, ctx: Context_T,
               message: Message_T, *,
               ensure_private: bool = False,
               ignore_failure: bool = True,
               **kwargs) -> Any:
    """"""
    try:
        if ensure_private:
            ctx = ctx.copy()
            ctx['message_type'] = 'private'
        return await bot.send(ctx, message, **kwargs)
    except CQHttpError:
        if not ignore_failure:
            raise
        return None
656283
function sendRequest()
  {
    // if this is a retry and a query parameter should be appended to the url on
    // retry, update the url
    if ((numRetries > 0) && appendQueryParamOnRetry)
    {
      options.url = Util.url.appendParam(urlOrig, 'retry', true);
    }

    sf.request(options);
  }
928614
def __spawn_new_request(self):
        

        first_in_line = self.queue.get_first(QueueItem.STATUS_QUEUED)
        
        if first_in_line is None:
            return False

        while self.routing.is_treshold_reached(first_in_line.request):
            self.queue.move(first_in_line, QueueItem.STATUS_CANCELLED)

            first_in_line = self.queue.get_first(QueueItem.STATUS_QUEUED)
            if first_in_line is None:
                return False

        self.__request_start(first_in_line)
        return True
309724
def send(self, request):
        
        if self.call is None:
            raise ValueError("Can not send() on an RPC that has never been open()ed.")

        # Don't use self.is_active(), as ResumableBidiRpc will overload it
        # to mean something semantically different.
        if self.call.is_active():
            self._request_queue.put(request)
        else:
            # calling next should cause the call to raise.
            next(self.call)
673580
private void sendPending() {
    while (outstanding.get() < concurrency) {
      final TopicQueue queue = pendingTopics.poll();
      if (queue == null) {
        return;
      }

      queue.pending = false;
      final int sent = queue.sendBatch();

      // Did we send a whole batch? Then there might be more messages in the queue. Mark as pending again.
      if (sent == batchSize) {
        queue.pending = true;
        pendingTopics.offer(queue);
      }
    }
  }
768737
def send(self, request: Request, stack: Stack) -> Coroutine:
        

        if stack.annotation not in self.PATTERNS:
            if not self.accept(stack):
                raise UnacceptableStack('Cannot accept stack {}'.format(stack))

        func = getattr(self, '_send_' + stack.annotation)
        return func(request, stack)