Thruway\ClientSession::call PHP Method

call() public method

Call
public call ( string $procedureName, array | mixed $arguments = null, array | mixed $argumentsKw = null, array | mixed $options = null ) : Promise
$procedureName string
$arguments array | mixed
$argumentsKw array | mixed
$options array | mixed
return React\Promise\Promise
    public function call($procedureName, $arguments = null, $argumentsKw = null, $options = null)
    {
        return $this->peer->getCaller()->call($this, $procedureName, $arguments, $argumentsKw, $options);
    }

Usage Example

 /**
  * Gets and published the topics state to this subscription
  *
  * @param Subscription $subscription
  * @return mixed
  */
 public function publishState(Subscription $subscription)
 {
     //Pause all non-state building event messages
     $subscription->pauseForState();
     $sessionId = $subscription->getSession()->getSessionId();
     $this->clientSession->call($this->getProcedureName(), [$subscription->getUri(), $sessionId, $subscription->getOptions(), $subscription->getSession()->getAuthenticationDetails()])->then(function ($res) use($subscription) {
         $pubId = null;
         if (isset($res[0])) {
             $pubId = $res[0];
         }
         $subscription->unPauseForState($pubId);
     }, function ($error) use($subscription) {
         Logger::error($this, "Could not call '{$this->getProcedureName()}' when restoring state");
         $subscription->unPauseForState();
     });
 }
All Usage Examples Of Thruway\ClientSession::call