Thruway\Role\Caller::call PHP Метод

call() публичный Метод

process call
public call ( ClientSession $session, string $procedureName, mixed $arguments = null, mixed $argumentsKw = null, mixed $options = null ) : Promise
$session Thruway\ClientSession
$procedureName string
$arguments mixed
$argumentsKw mixed
$options mixed
Результат React\Promise\Promise
    public function call(ClientSession $session, $procedureName, $arguments = null, $argumentsKw = null, $options = null)
    {
        //This promise gets resolved in Caller::processResult
        $futureResult = new Deferred();
        $requestId = Utils::getUniqueId();
        $this->callRequests[$requestId] = ["procedure_name" => $procedureName, "future_result" => $futureResult];
        if (is_array($options)) {
            $options = (object) $options;
        }
        if (!is_object($options)) {
            if ($options !== null) {
                Logger::warning($this, "Options don't appear to be the correct type.");
            }
            $options = new \stdClass();
        }
        $callMsg = new CallMessage($requestId, $options, $procedureName, $arguments, $argumentsKw);
        $session->sendMessage($callMsg);
        return $futureResult->promise();
    }