Sends a request.

@param  integer $max The number of simultaneous allowed connections.
@return array        The response.
762882
public function send($request, $response, $options = [])
    {
        $this->push($request, $response, $options);
        $result = $this->flush(10, $options);
        return $response;
    }
1329742
public function executeAll($max = 50)
    {
        $sth = $this->getDb()->prepare('SELECT * FROM ' . $this->queueTable . ' WHERE 1');
        $sth->execute();
        foreach($sth->fetchAll() as $queue) {
            $q = new Queue($queue['queue_name'], $queue['timeout']);
            $q->setManager($this);
            $q->execute($max);
        }
    }
1336682
public function send($params)
    {
        $rst = $this->_request->post($this->_url . 'message/mass/send', $params);
        return $this->_client->rst($rst);
    }
127339
public static function send($request, $handlerClass = null)
    {
        if(null === $handlerClass)
        {
            $handlerClass = static::$defaultHandler;
        }
        $handler = new $handlerClass();
        $time = microtime(true);
        foreach(static::$attributes as $name => $value)
        {
            if(null === $request->getAttribute($name))
            {
                $request = $request->withAttribute($name, $value);
            }
        }
        $handler->send($request);
        $response = $handler->recv();
        $response = $response->withTotalTime(microtime(true) - $time);
        return $response;
    }
1157802
public function sendRequest(Request $request)
    {
        foreach ($this->automaticRequestHeaders->getAll() as $name => $values) {
            $request->setHeader($name, $values);
        }

        $this->lastRequest = $request;
        $this->lastResponse = $this->requestEngine->sendRequest($request);
        return $this->lastResponse;
    }
1317032
protected function _fillup($max)
    {
        $nb = $max - $this->_running;
        $list = array_splice($this->_queue, 0, $nb);
        foreach ($list as $item) {
            $handle = $this->_initRequest($item['socket'], $item['response']);
            $this->_handles[(integer) $handle] = $item;
            curl_multi_add_handle($this->_curl, $handle);
        }
    }
11158
protected function send(Request $request)
    {
        try {
            $response = $this->client->send($request);
        } catch (ClientException $e) {
            $response = $e->getResponse();
        } catch (ServerException $e) {
            $response = $e->getResponse();
        }

        return $response;
    }
236277
private function send(Request $request)
    {
        $options = [
            'base_uri' => self::BASE_URI,
            'http_errors' => false,
        ];

        return $this->client->send($request, $options);
    }
1203270
private function send_request() {
        // check if stream is declared to be open
        // only logical check we are not sure if socket is really still open ...
        if ($this->_connection_closed) {
            // reopen it
            // be sure to close the open socket.
            $this->close();
            $this->reopen();
        }

        // convert array to string
        $buffer = implode("\r\n", $this->_req);
        $buffer .= "\r\n\r\n";
        $this->_error_log($buffer);
        fputs($this->sock, $buffer);
    }
1205117
public function sendBatchRequest(array $requests)
    {
        $batchRequest = new BatchRequest($this->endpoint, $this->secret, $requests);

        return $this->lastResponse = $this->client->sendBatchRequest($batchRequest);
    }
1335459
public function setMax($max)
  {
    if (!is_numeric($max))
    {
      $max = null;
    }
    $this->max = $max;

    return $this;
  }
415700
public function send($request)
    {
        $this->handle->init();

        $this->handle->setOption(CURLOPT_URL, $request->getURL());
        $this->handle->setOption(CURLOPT_HTTPHEADER, $request->getHeaders());
        $this->handle->setOption(CURLOPT_RETURNTRANSFER, true);
        $this->handle->setOption(CURLOPT_CONNECTTIMEOUT, $this->getTimeout());
        $this->handle->setOption(CURLOPT_TIMEOUT, $this->getTimeout());
        $this->handle->setOption(CURLOPT_SSL_VERIFYHOST, 2);
        $this->handle->setOption(CURLOPT_SSL_VERIFYPEER, true);

        $data = $this->handle->execute();
        $info = $this->handle->getInfo();
        $error = $this->handle->getError();

        $this->handle->close();

        /*
         * A failure occurred if:
         * payload is false (e.g. HTTP timeout?).
         * info is false, then it has no HTTP status code.
         */
        if (strlen($error) > 0) {
            throw new KlarnaException(
                "Connection failed with error: {$error}"
            );
        }

        return $request->createResponse(intval($info['http_code']), $data);
    }
805939
public function send(RequestInterface $request)
	{
		$request = $this->authentication($request);
		$defaultHeaders = [
			'Accept'       => $this->getContentType(),
			'Content-Type' => $this->getContentType()
		];

		foreach ($defaultHeaders as $defaultHeader => $value)
		{
			if ( ! $request->hasHeader($defaultHeader))
			{
				$request = $request->withHeader($defaultHeader, $value);
			}
		}

		$response = $this->client->sendRequest($request);
		$response = $this->transformResponseToException($request, $response);

		return $response;
	}
381414
public function sendRequest($data)
    {
        return $this->httpClient->request(
            $this->getHttpMethod(),
            $this->getEndpoint(),
            [
                'Accept' => 'application/json',
                'Authorization' => $this->getServiceKey(),
                'Content-Type' => 'application/json',
            ],
            json_encode($data)
        );
    }
770582
public function send(Request $request)
    {
        $response = new SearchResponse();
        $rpbReq   = $this->createRpbMessage($request);
        $rpbResp  = $this->client->send($rpbReq, RiakMessageCodes::SEARCH_QUERY_REQ, RiakMessageCodes::SEARCH_QUERY_RESP);

        if ( ! $rpbResp instanceof RpbSearchQueryResp) {
            return $response;
        }

        $response->numFound = $rpbResp->num_found;
        $response->maxScore = $rpbResp->max_score;

        if ( ! $rpbResp->hasDocs()) {
            return $response;
        }

        $response->docs = array_map([$this, 'docToArray'], $rpbResp->docs);

        return $response;
    }
1206436
public function sendNormal(array $params)
    {
        $base = [
            'total_num' => 1,
            'client_ip' => $params['client_ip'] ?? Support\get_server_ip(),
            'wxappid' => $this->app['config']->app_id,
        ];

        return $this->safeRequest('mmpaymkttransfers/sendredpack', array_merge($base, $params));
    }
46986
public function send()
    {
        $this->client->notifyPlugins('beforeRequest', [$this]);
        if (isset($this->options['async'])) {
            $async = $this->options['async'];
            if (is_bool($async)) {
                $async = var_export($async, true);
            }
            $this->headers['x-arango-async'] = $async;
        }

        if (isset($this->options['isBatchPart']) && $this->options['isBatchPart'] === true) {
            //            $this->isBatchPart = true;
            $this->address = $this->client->endpoint . $this->path;

            //todo: Revisit this:
            return true;
        } else {
            if (null !== $this->options && (!array_key_exists(
                        'isBatchRequest',
                        $this->options
                    ) || (isset($this->options['isBatchRequest']) && $this->options['isBatchRequest'] !== true))
            ) {
                $this->headers['Content-Type'] = 'application/json';
            }
            $this->address  = $this->client->endpoint . $this->path;
            $this->response = $this->client->connector->send($this);
        }

        return $this->client->doRequest($this);
    }