Sent request and get response from a service

@param $message
@return object
342709
public function send($message)
    {
        return $this->response->hydrate(
            $this->getPromise($message)
                ->receive()
                ->getBody()
        );
    }
1070512
protected function respondNotFound($message = '')
    {
        if (empty($message))
        {
            $message = ucfirst($this->baseClass).' does not exist';
        }

        return $this->respondWithError($message, 404);
    }
1345997
public function respondDeleted($message = "Deleted")
    {
        $reponse = $this->setStatusCode(ResponseHTTP::HTTP_ACCEPTED)
            ->respondWithMessage($message);
        return $reponse;
    }
77567
protected function handleMessage($message)
    {
        $handler = $this->messageHandler;

        if (!is_callable($handler)) {
            Log::debug('No handler enabled.');

            return null;
        }

        Log::debug('Message detail:', $message->all());

        $type = $this->messageTypeMapping[ $message->get('InfoType') ];

        $response = null;

        if ($type) {
            $response = call_user_func_array($handler, [$message]);
        }

        return $response;
    }
313221
public function a($message) {
        return isset($this->messages[$message]) ? $this->messages[$message] : $message;
    }
1190524
protected function _watch($message)
    {
        $reference = $message->reference();
        if (!$reference) {
            Suite::register($message->name());
            return $message;
        }
        if (is_object($reference)) {
            Suite::register(get_class($reference));
        }
        Suite::register(Suite::hash($reference));
        return $message;
    }
170686
public function respondUnauthorized($message = null): JsonResponse
    {
        return $this->setStatusCode(IlluminateResponse::HTTP_UNAUTHORIZED)
            ->respondWithError(ApiResponse::CODE_NOT_AUTHORIZED, $message);
    }
703183
private function _prepareMessage($message)
    {
        if (is_string($message) || is_numeric($message)) {
            return $message;
        }
        
        if (is_array($message)) {
            return json_encode($message, JSON_UNESCAPED_UNICODE);
        }
        
        return null;
    }
1168838
protected function notFound(string $message = 'Not found.'): Response
    {
        return $this->getResponse()
            ->setContent($message)
            ->setStatusCode(Response::HTTP_NOT_FOUND);
    }
125597
public function sendMessage(Message $message)
    {
        $this->currentId++;
        $messageData = $message->convertToRconData($this->currentId);
        $this->client->write($messageData);

        return $this->getResponseMessage();
    }
855682
public function translate($message)
    {
        $locale = $this->configuration
            ->get('i18n.locale', $this->fallbackLocale);

        return $this->getTranslatorService()
            ->translate($message, $this->domain, $locale);
    }
902815
public function deserialize($message)
    {
        $serializedDomainMessageStream = @json_decode($message, true);

        if (json_last_error() !== JSON_ERROR_NONE) {
            throw new DeserializeException(json_last_error_msg());
        }

        try {
            Assertion::isArray($serializedDomainMessageStream);
        } catch (InvalidArgumentException $exception) {
            //@TODO remove this try catch in BC
            throw new DeserializeException($exception->getMessage(), $exception->getCode(), $exception);
        }

        $domainMessages = [];
        foreach ($serializedDomainMessageStream as $serializedDomainMessage) {
            $domainMessages[] = $this->serializer->deserialize($serializedDomainMessage);
        }

        return new DomainEventStream($domainMessages);
    }
714713
public function createRequest(PushMessage $message) : RequestInterface
    {
        $host = $message->getPushSubscription()->getEndpoint()->getHost();
        $pushService = $this->pushServiceRegistry->getPushService($host);

        return $pushService->createRequest($message);
    }
661773
public function parseRequest($message)
    {
        if (!($parts = $this->parseMessage($message))) {
            return false;
        }

        // Parse the protocol and protocol version
        if (isset($parts['start_line'][2])) {
            $startParts = explode('/', $parts['start_line'][2]);
            $protocol = strtoupper($startParts[0]);
            $version = isset($startParts[1]) ? $startParts[1] : '1.1';
        } else {
            $protocol = 'HTTP';
            $version = '1.1';
        }

        $parsed = [
            'method'   => strtoupper($parts['start_line'][0]),
            'protocol' => $protocol,
            'protocol_version' => $version,
            'headers'  => $parts['headers'],
            'body'     => $parts['body']
        ];

        $parsed['request_url'] = $this->getUrlPartsFromMessage(
            (isset($parts['start_line'][1]) ? $parts['start_line'][1] : ''), $parsed);

        return $parsed;
    }
1303207
public function statusMessage($message = '')
    {
        $statusCode = $this->getStatusCode();

        if (!isset(ResponseHeader::$httpStatus[$statusCode])) {
            throw new ResponseException(sprintf('Invalid status code provided %s', $statusCode));
        }

        if (!empty($message)) {
            $this->statusMessage = $message;

            return $this;
        }

        $this->statusMessage = ResponseHeader::$httpStatus[$statusCode];

        return $this;
    }
54589
public function sendMessage($message, $getResponse = true, $eol = "\r\n") {
		fputs($this->conn, $message . $eol);
		
		if (!$getResponse) return null;
		
		// read answer from server
		return $this->getResponse();
	}
1368763
public function respondWithMessage($message = "Ok")
    {
        $data = $this->getResponseStructure(true, null, $message);

        return $this->respond($data);
    }