Ejemplo n.º 1
0
 /**
  * Call a remote method with messages streaming in both directions.
  *
  * @param string   $method      The name of the method to call
  * @param callable $deserialize A function that deserializes the responses
  * @param array    $metadata    A metadata map to send to the server
  *
  * @return BidiStreamingSurfaceActiveCall The active call object
  */
 public function _bidiRequest($method, callable $deserialize, $metadata = [])
 {
     list($actual_metadata, $timeout) = $this->_extract_timeout_from_metadata($metadata);
     $call = new BidiStreamingCall($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);
     }
     $actual_metadata = $this->_validate_and_normalize_metadata($actual_metadata);
     $call->start($actual_metadata);
     return $call;
 }
Ejemplo n.º 2
0
 /**
  * Call a remote method with messages streaming in both directions.
  *
  * @param string   $method      The name of the method to call
  * @param callable $deserialize A function that deserializes the responses
  * @param array    $metadata    A metadata map to send to the server
  *
  * @return BidiStreamingSurfaceActiveCall The active call object
  */
 public function _bidiRequest($method, callable $deserialize, $metadata = [], $options = [])
 {
     $call = new BidiStreamingCall($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($metadata);
     return $call;
 }
Ejemplo n.º 3
0
 /**
  * Call a remote method with messages streaming in both directions
  *
  * @param string $method The name of the method to call
  * @param callable $deserialize A function that deserializes the responses
  * @param array $metadata A metadata map to send to the server
  * @return BidiStreamingSurfaceActiveCall The active call object
  */
 public function _bidiRequest($method, callable $deserialize, $metadata = array())
 {
     $call = new BidiStreamingCall($this->channel, $method, $deserialize);
     $call->start($metadata);
     return $call;
 }