/** * Call a remote method that takes a single argument and returns a stream of * responses * * @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 responses * @param array $metadata A metadata map to send to the server * @return ServerStreamingSurfaceActiveCall The active call object */ public function _serverStreamRequest($method, $argument, callable $deserialize, $metadata = array()) { list($actual_metadata, $timeout) = $this->_extract_timeout_from_metadata($metadata); $call = new ServerStreamingCall($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; }
/** * Call a remote method that takes a single argument and returns a stream of * responses. * * @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 responses * @param array $metadata A metadata map to send to the server * * @return ServerStreamingSurfaceActiveCall The active call object */ public function _serverStreamRequest($method, $argument, callable $deserialize, $metadata = [], $options = []) { $call = new ServerStreamingCall($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; }
/** * Call a remote method that takes a single argument and returns a stream of * responses * * @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 responses * @param array $metadata A metadata map to send to the server * @return ServerStreamingSurfaceActiveCall The active call object */ public function _serverStreamRequest($method, $argument, callable $deserialize, $metadata = array()) { $call = new ServerStreamingCall($this->channel, $method, $deserialize); $call->start($argument, $metadata); return $call; }