mlumish | b892a27 | 2014-12-09 16:28:23 -0800 | [diff] [blame] | 1 | <?php |
Craig Tiller | 2e498aa | 2015-02-16 12:09:31 -0800 | [diff] [blame] | 2 | /* |
| 3 | * |
| 4 | * Copyright 2015, Google Inc. |
| 5 | * All rights reserved. |
| 6 | * |
| 7 | * Redistribution and use in source and binary forms, with or without |
| 8 | * modification, are permitted provided that the following conditions are |
| 9 | * met: |
| 10 | * |
| 11 | * * Redistributions of source code must retain the above copyright |
| 12 | * notice, this list of conditions and the following disclaimer. |
| 13 | * * Redistributions in binary form must reproduce the above |
| 14 | * copyright notice, this list of conditions and the following disclaimer |
| 15 | * in the documentation and/or other materials provided with the |
| 16 | * distribution. |
| 17 | * * Neither the name of Google Inc. nor the names of its |
| 18 | * contributors may be used to endorse or promote products derived from |
| 19 | * this software without specific prior written permission. |
| 20 | * |
| 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 24 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 25 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 26 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 27 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 28 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 29 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 30 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 31 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 32 | * |
| 33 | */ |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 34 | |
mlumish | b892a27 | 2014-12-09 16:28:23 -0800 | [diff] [blame] | 35 | namespace Grpc; |
mlumish | b892a27 | 2014-12-09 16:28:23 -0800 | [diff] [blame] | 36 | |
| 37 | /** |
| 38 | * Base class for generated client stubs. Stub methods are expected to call |
| 39 | * _simpleRequest or _streamRequest and return the result. |
| 40 | */ |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 41 | class BaseStub |
| 42 | { |
| 43 | private $hostname; |
Stanley Cheung | cde12a5 | 2016-09-01 22:03:20 -0700 | [diff] [blame] | 44 | private $hostname_override; |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 45 | private $channel; |
mlumish | b892a27 | 2014-12-09 16:28:23 -0800 | [diff] [blame] | 46 | |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 47 | // a callback function |
| 48 | private $update_metadata; |
mlumish | b892a27 | 2014-12-09 16:28:23 -0800 | [diff] [blame] | 49 | |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 50 | /** |
| 51 | * @param $hostname string |
| 52 | * @param $opts array |
| 53 | * - 'update_metadata': (optional) a callback function which takes in a |
| 54 | * metadata array, and returns an updated metadata array |
Stanley Cheung | 3baf767 | 2015-11-08 18:16:58 -0800 | [diff] [blame] | 55 | * - 'grpc.primary_user_agent': (optional) a user-agent string |
Stanley Cheung | e05d319 | 2016-05-18 15:06:39 -0700 | [diff] [blame] | 56 | * @param $channel Channel An already created Channel object |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 57 | */ |
Stanley Cheung | e05d319 | 2016-05-18 15:06:39 -0700 | [diff] [blame] | 58 | public function __construct($hostname, $opts, $channel = null) |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 59 | { |
thinkerou | f3bc3b6 | 2016-06-09 11:57:15 +0800 | [diff] [blame] | 60 | $ssl_roots = file_get_contents( |
| 61 | dirname(__FILE__).'/../../../../etc/roots.pem'); |
| 62 | ChannelCredentials::setDefaultRootsPem($ssl_roots); |
| 63 | |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 64 | $this->hostname = $hostname; |
| 65 | $this->update_metadata = null; |
| 66 | if (isset($opts['update_metadata'])) { |
| 67 | if (is_callable($opts['update_metadata'])) { |
| 68 | $this->update_metadata = $opts['update_metadata']; |
| 69 | } |
| 70 | unset($opts['update_metadata']); |
| 71 | } |
| 72 | $package_config = json_decode( |
| 73 | file_get_contents(dirname(__FILE__).'/../../composer.json'), true); |
Stanley Cheung | 3baf767 | 2015-11-08 18:16:58 -0800 | [diff] [blame] | 74 | if (!empty($opts['grpc.primary_user_agent'])) { |
| 75 | $opts['grpc.primary_user_agent'] .= ' '; |
| 76 | } else { |
| 77 | $opts['grpc.primary_user_agent'] = ''; |
| 78 | } |
Stanley Cheung | cde12a5 | 2016-09-01 22:03:20 -0700 | [diff] [blame] | 79 | if (!empty($opts['grpc.ssl_target_name_override'])) { |
| 80 | $this->hostname_override = $opts['grpc.ssl_target_name_override']; |
| 81 | } |
Stanley Cheung | 3baf767 | 2015-11-08 18:16:58 -0800 | [diff] [blame] | 82 | $opts['grpc.primary_user_agent'] .= |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 83 | 'grpc-php/'.$package_config['version']; |
Stanley Cheung | 6bd3180 | 2015-12-16 12:58:19 -0800 | [diff] [blame] | 84 | if (!array_key_exists('credentials', $opts)) { |
| 85 | throw new \Exception("The opts['credentials'] key is now ". |
| 86 | 'required. Please see one of the '. |
| 87 | 'ChannelCredentials::create methods'); |
| 88 | } |
Stanley Cheung | e05d319 | 2016-05-18 15:06:39 -0700 | [diff] [blame] | 89 | if ($channel) { |
| 90 | if (!is_a($channel, 'Channel')) { |
thinkerou | a3730b7 | 2016-07-20 16:59:54 +0800 | [diff] [blame] | 91 | throw new \Exception('The channel argument is not a'. |
| 92 | 'Channel object'); |
Stanley Cheung | e05d319 | 2016-05-18 15:06:39 -0700 | [diff] [blame] | 93 | } |
| 94 | $this->channel = $channel; |
| 95 | } else { |
| 96 | $this->channel = new Channel($hostname, $opts); |
| 97 | } |
Stanley Cheung | 04b7a41 | 2015-08-13 09:39:04 -0700 | [diff] [blame] | 98 | } |
| 99 | |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 100 | /** |
| 101 | * @return string The URI of the endpoint. |
| 102 | */ |
| 103 | public function getTarget() |
| 104 | { |
| 105 | return $this->channel->getTarget(); |
Stanley Cheung | 04b7a41 | 2015-08-13 09:39:04 -0700 | [diff] [blame] | 106 | } |
Stanley Cheung | 04b7a41 | 2015-08-13 09:39:04 -0700 | [diff] [blame] | 107 | |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 108 | /** |
| 109 | * @param $try_to_connect bool |
| 110 | * |
| 111 | * @return int The grpc connectivity state |
| 112 | */ |
| 113 | public function getConnectivityState($try_to_connect = false) |
| 114 | { |
| 115 | return $this->channel->getConnectivityState($try_to_connect); |
Stanley Cheung | 04b7a41 | 2015-08-13 09:39:04 -0700 | [diff] [blame] | 116 | } |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 117 | |
| 118 | /** |
Stanislav Pavlovichev | 4407a94 | 2016-10-27 10:35:08 +0700 | [diff] [blame] | 119 | * @param int $timeout in microseconds |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 120 | * |
| 121 | * @return bool true if channel is ready |
| 122 | * @throw Exception if channel is in FATAL_ERROR state |
| 123 | */ |
| 124 | public function waitForReady($timeout) |
| 125 | { |
| 126 | $new_state = $this->getConnectivityState(true); |
| 127 | if ($this->_checkConnectivityState($new_state)) { |
| 128 | return true; |
| 129 | } |
| 130 | |
| 131 | $now = Timeval::now(); |
| 132 | $delta = new Timeval($timeout); |
| 133 | $deadline = $now->add($delta); |
| 134 | |
| 135 | while ($this->channel->watchConnectivityState($new_state, $deadline)) { |
| 136 | // state has changed before deadline |
| 137 | $new_state = $this->getConnectivityState(); |
| 138 | if ($this->_checkConnectivityState($new_state)) { |
| 139 | return true; |
| 140 | } |
| 141 | } |
| 142 | // deadline has passed |
| 143 | $new_state = $this->getConnectivityState(); |
| 144 | |
| 145 | return $this->_checkConnectivityState($new_state); |
Stanley Cheung | 04b7a41 | 2015-08-13 09:39:04 -0700 | [diff] [blame] | 146 | } |
Stanley Cheung | 04b7a41 | 2015-08-13 09:39:04 -0700 | [diff] [blame] | 147 | |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 148 | private function _checkConnectivityState($new_state) |
| 149 | { |
| 150 | if ($new_state == \Grpc\CHANNEL_READY) { |
| 151 | return true; |
| 152 | } |
| 153 | if ($new_state == \Grpc\CHANNEL_FATAL_FAILURE) { |
| 154 | throw new \Exception('Failed to connect to server'); |
| 155 | } |
mlumish | b892a27 | 2014-12-09 16:28:23 -0800 | [diff] [blame] | 156 | |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 157 | return false; |
Stanley Cheung | f420687 | 2015-05-12 17:39:30 -0700 | [diff] [blame] | 158 | } |
Stanley Cheung | f420687 | 2015-05-12 17:39:30 -0700 | [diff] [blame] | 159 | |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 160 | /** |
| 161 | * Close the communication channel associated with this stub. |
| 162 | */ |
| 163 | public function close() |
| 164 | { |
| 165 | $this->channel->close(); |
Stanley Cheung | cc019af | 2015-06-15 11:45:00 -0700 | [diff] [blame] | 166 | } |
Stanley Cheung | cc019af | 2015-06-15 11:45:00 -0700 | [diff] [blame] | 167 | |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 168 | /** |
| 169 | * constructs the auth uri for the jwt. |
| 170 | */ |
| 171 | private function _get_jwt_aud_uri($method) |
| 172 | { |
| 173 | $last_slash_idx = strrpos($method, '/'); |
| 174 | if ($last_slash_idx === false) { |
| 175 | throw new \InvalidArgumentException( |
| 176 | 'service name must have a slash'); |
| 177 | } |
| 178 | $service_name = substr($method, 0, $last_slash_idx); |
| 179 | |
Stanley Cheung | cde12a5 | 2016-09-01 22:03:20 -0700 | [diff] [blame] | 180 | if ($this->hostname_override) { |
| 181 | $hostname = $this->hostname_override; |
| 182 | } else { |
| 183 | $hostname = $this->hostname; |
| 184 | } |
thinkerou | 9392b04 | 2016-09-09 17:43:00 +0800 | [diff] [blame] | 185 | |
Stanley Cheung | cde12a5 | 2016-09-01 22:03:20 -0700 | [diff] [blame] | 186 | return 'https://'.$hostname.$service_name; |
Stanley Cheung | b0cd08a | 2015-10-09 16:58:01 -0700 | [diff] [blame] | 187 | } |
Stanley Cheung | b0cd08a | 2015-10-09 16:58:01 -0700 | [diff] [blame] | 188 | |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 189 | /** |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 190 | * validate and normalize the metadata array. |
| 191 | * |
Stanislav Pavlovichev | 4407a94 | 2016-10-27 10:35:08 +0700 | [diff] [blame] | 192 | * @param array $metadata The metadata map |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 193 | * |
| 194 | * @return $metadata Validated and key-normalized metadata map |
| 195 | * @throw InvalidArgumentException if key contains invalid characters |
| 196 | */ |
| 197 | private function _validate_and_normalize_metadata($metadata) |
| 198 | { |
| 199 | $metadata_copy = []; |
| 200 | foreach ($metadata as $key => $value) { |
| 201 | if (!preg_match('/^[A-Za-z\d_-]+$/', $key)) { |
| 202 | throw new \InvalidArgumentException( |
| 203 | 'Metadata keys must be nonempty strings containing only '. |
| 204 | 'alphanumeric characters, hyphens and underscores'); |
| 205 | } |
| 206 | $metadata_copy[strtolower($key)] = $value; |
| 207 | } |
| 208 | |
| 209 | return $metadata_copy; |
| 210 | } |
| 211 | |
| 212 | /* This class is intended to be subclassed by generated code, so |
| 213 | * all functions begin with "_" to avoid name collisions. */ |
| 214 | |
| 215 | /** |
| 216 | * Call a remote method that takes a single argument and has a |
| 217 | * single output. |
| 218 | * |
Stanislav Pavlovichev | 4407a94 | 2016-10-27 10:35:08 +0700 | [diff] [blame] | 219 | * @param string $method The name of the method to call |
| 220 | * @param mixed $argument The argument to the method |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 221 | * @param callable $deserialize A function that deserializes the response |
| 222 | * @param array $metadata A metadata map to send to the server |
| 223 | * |
| 224 | * @return SimpleSurfaceActiveCall The active call object |
| 225 | */ |
| 226 | public function _simpleRequest($method, |
| 227 | $argument, |
Parker Moore | 513a688 | 2015-12-01 16:59:49 -0800 | [diff] [blame] | 228 | $deserialize, |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 229 | $metadata = [], |
| 230 | $options = []) |
| 231 | { |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 232 | $call = new UnaryCall($this->channel, |
| 233 | $method, |
| 234 | $deserialize, |
Stanley Cheung | 3580580 | 2015-12-10 11:42:55 -0800 | [diff] [blame] | 235 | $options); |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 236 | $jwt_aud_uri = $this->_get_jwt_aud_uri($method); |
| 237 | if (is_callable($this->update_metadata)) { |
Stanley Cheung | 3580580 | 2015-12-10 11:42:55 -0800 | [diff] [blame] | 238 | $metadata = call_user_func($this->update_metadata, |
| 239 | $metadata, |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 240 | $jwt_aud_uri); |
| 241 | } |
Stanley Cheung | 3580580 | 2015-12-10 11:42:55 -0800 | [diff] [blame] | 242 | $metadata = $this->_validate_and_normalize_metadata( |
| 243 | $metadata); |
| 244 | $call->start($argument, $metadata, $options); |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 245 | |
| 246 | return $call; |
| 247 | } |
| 248 | |
| 249 | /** |
| 250 | * Call a remote method that takes a stream of arguments and has a single |
| 251 | * output. |
| 252 | * |
Stanislav Pavlovichev | 4407a94 | 2016-10-27 10:35:08 +0700 | [diff] [blame] | 253 | * @param string $method The name of the method to call |
| 254 | * @param array $arguments An array or Traversable of arguments to stream to the |
thinkerou | 9a669b6 | 2016-11-01 21:31:43 +0800 | [diff] [blame] | 255 | * server |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 256 | * @param callable $deserialize A function that deserializes the response |
| 257 | * @param array $metadata A metadata map to send to the server |
| 258 | * |
| 259 | * @return ClientStreamingSurfaceActiveCall The active call object |
| 260 | */ |
| 261 | public function _clientStreamRequest($method, |
| 262 | callable $deserialize, |
Stanley Cheung | 3580580 | 2015-12-10 11:42:55 -0800 | [diff] [blame] | 263 | $metadata = [], |
| 264 | $options = []) |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 265 | { |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 266 | $call = new ClientStreamingCall($this->channel, |
| 267 | $method, |
| 268 | $deserialize, |
Stanley Cheung | 3580580 | 2015-12-10 11:42:55 -0800 | [diff] [blame] | 269 | $options); |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 270 | $jwt_aud_uri = $this->_get_jwt_aud_uri($method); |
| 271 | if (is_callable($this->update_metadata)) { |
Stanley Cheung | 3580580 | 2015-12-10 11:42:55 -0800 | [diff] [blame] | 272 | $metadata = call_user_func($this->update_metadata, |
| 273 | $metadata, |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 274 | $jwt_aud_uri); |
| 275 | } |
Stanley Cheung | 3580580 | 2015-12-10 11:42:55 -0800 | [diff] [blame] | 276 | $metadata = $this->_validate_and_normalize_metadata( |
| 277 | $metadata); |
| 278 | $call->start($metadata); |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 279 | |
| 280 | return $call; |
| 281 | } |
| 282 | |
| 283 | /** |
| 284 | * Call a remote method that takes a single argument and returns a stream of |
| 285 | * responses. |
| 286 | * |
Stanislav Pavlovichev | 4407a94 | 2016-10-27 10:35:08 +0700 | [diff] [blame] | 287 | * @param string $method The name of the method to call |
| 288 | * @param mixed $argument The argument to the method |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 289 | * @param callable $deserialize A function that deserializes the responses |
| 290 | * @param array $metadata A metadata map to send to the server |
| 291 | * |
| 292 | * @return ServerStreamingSurfaceActiveCall The active call object |
| 293 | */ |
| 294 | public function _serverStreamRequest($method, |
| 295 | $argument, |
| 296 | callable $deserialize, |
| 297 | $metadata = [], |
| 298 | $options = []) |
| 299 | { |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 300 | $call = new ServerStreamingCall($this->channel, |
| 301 | $method, |
| 302 | $deserialize, |
Stanley Cheung | 3580580 | 2015-12-10 11:42:55 -0800 | [diff] [blame] | 303 | $options); |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 304 | $jwt_aud_uri = $this->_get_jwt_aud_uri($method); |
| 305 | if (is_callable($this->update_metadata)) { |
Stanley Cheung | 3580580 | 2015-12-10 11:42:55 -0800 | [diff] [blame] | 306 | $metadata = call_user_func($this->update_metadata, |
| 307 | $metadata, |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 308 | $jwt_aud_uri); |
| 309 | } |
Stanley Cheung | 3580580 | 2015-12-10 11:42:55 -0800 | [diff] [blame] | 310 | $metadata = $this->_validate_and_normalize_metadata( |
| 311 | $metadata); |
| 312 | $call->start($argument, $metadata, $options); |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 313 | |
| 314 | return $call; |
| 315 | } |
| 316 | |
| 317 | /** |
| 318 | * Call a remote method with messages streaming in both directions. |
| 319 | * |
| 320 | * @param string $method The name of the method to call |
| 321 | * @param callable $deserialize A function that deserializes the responses |
| 322 | * @param array $metadata A metadata map to send to the server |
| 323 | * |
| 324 | * @return BidiStreamingSurfaceActiveCall The active call object |
| 325 | */ |
| 326 | public function _bidiRequest($method, |
murgatroid99 | 14d2ce2 | 2015-01-30 15:36:23 -0800 | [diff] [blame] | 327 | callable $deserialize, |
Stanley Cheung | 3580580 | 2015-12-10 11:42:55 -0800 | [diff] [blame] | 328 | $metadata = [], |
| 329 | $options = []) |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 330 | { |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 331 | $call = new BidiStreamingCall($this->channel, |
| 332 | $method, |
| 333 | $deserialize, |
Stanley Cheung | 3580580 | 2015-12-10 11:42:55 -0800 | [diff] [blame] | 334 | $options); |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 335 | $jwt_aud_uri = $this->_get_jwt_aud_uri($method); |
| 336 | if (is_callable($this->update_metadata)) { |
Stanley Cheung | 3580580 | 2015-12-10 11:42:55 -0800 | [diff] [blame] | 337 | $metadata = call_user_func($this->update_metadata, |
| 338 | $metadata, |
Stanley Cheung | f420687 | 2015-05-12 17:39:30 -0700 | [diff] [blame] | 339 | $jwt_aud_uri); |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 340 | } |
Stanley Cheung | 3580580 | 2015-12-10 11:42:55 -0800 | [diff] [blame] | 341 | $metadata = $this->_validate_and_normalize_metadata( |
| 342 | $metadata); |
| 343 | $call->start($metadata); |
mlumish | b892a27 | 2014-12-09 16:28:23 -0800 | [diff] [blame] | 344 | |
Stanley Cheung | d5b2056 | 2015-10-27 13:27:05 -0700 | [diff] [blame] | 345 | return $call; |
Stanley Cheung | 2c9c763 | 2015-04-20 14:13:54 -0700 | [diff] [blame] | 346 | } |
mlumish | b892a27 | 2014-12-09 16:28:23 -0800 | [diff] [blame] | 347 | } |