コード例 #1
0
ファイル: BaseStub.php プロジェクト: rootusr/grpc
 /**
  * Call a remote method that takes a single argument and has a single output
  *
  * @param string $method The name of the method to call
  * @param $argument The argument to the method
  * @param callable $deserialize A function that deserializes the response
  * @param array $metadata A metadata map to send to the server
  * @return SimpleSurfaceActiveCall The active call object
  */
 public function _simpleRequest($method, $argument, callable $deserialize, $metadata = array())
 {
     list($actual_metadata, $timeout) = $this->_extract_timeout_from_metadata($metadata);
     $call = new UnaryCall($this->channel, $method, $deserialize, $timeout);
     $jwt_aud_uri = $this->_get_jwt_aud_uri($method);
     if (is_callable($this->update_metadata)) {
         $actual_metadata = call_user_func($this->update_metadata, $actual_metadata, $jwt_aud_uri);
     }
     $call->start($argument, $actual_metadata);
     return $call;
 }
コード例 #2
0
ファイル: BaseStub.php プロジェクト: AlunYou/grpc
 /**
  * Call a remote method that takes a single argument and has a
  * single output.
  *
  * @param string $method The name of the method to call
  * @param $argument The argument to the method
  * @param callable $deserialize A function that deserializes the response
  * @param array    $metadata    A metadata map to send to the server
  *
  * @return SimpleSurfaceActiveCall The active call object
  */
 public function _simpleRequest($method, $argument, $deserialize, $metadata = [], $options = [])
 {
     $call = new UnaryCall($this->channel, $method, $deserialize, $options);
     $jwt_aud_uri = $this->_get_jwt_aud_uri($method);
     if (is_callable($this->update_metadata)) {
         $metadata = call_user_func($this->update_metadata, $metadata, $jwt_aud_uri);
     }
     $metadata = $this->_validate_and_normalize_metadata($metadata);
     $call->start($argument, $metadata, $options);
     return $call;
 }
コード例 #3
0
ファイル: BaseStub.php プロジェクト: is00hcw/kythe
 /**
  * Call a remote method that takes a single argument and has a single output
  *
  * @param string $method The name of the method to call
  * @param $argument The argument to the method
  * @param callable $deserialize A function that deserializes the response
  * @param array $metadata A metadata map to send to the server
  * @return SimpleSurfaceActiveCall The active call object
  */
 public function _simpleRequest($method, $argument, callable $deserialize, $metadata = array())
 {
     $call = new UnaryCall($this->channel, $method, $deserialize);
     $call->start($argument, $metadata);
     return $call;
 }