affinity_conf = $affinity_conf; } /** * @param string $hostname * @param array $opts * @return GcpExtensionChannel */ public function createChannelFactory($hostname, $opts) { if ($this->channel) { // $call_invoker object has already created from previews PHP-FPM scripts. // Only need to udpate the $opts including the credentials. $this->channel->updateOpts($opts); } else { $opts['affinity_conf'] = $this->affinity_conf; $channel = new GcpExtensionChannel($hostname, $opts); $this->channel = $channel; } return $this->channel; } // _getChannel is used for testing only. public function GetChannel() { return $this->channel; } public function UnaryCall($channel, $method, $deserialize, $options) { return new GCPUnaryCall($channel, $method, $deserialize, $options); } public function ClientStreamingCall($channel, $method, $deserialize, $options) { return new GCPClientStreamCall($channel, $method, $deserialize, $options); } public function ServerStreamingCall($channel, $method, $deserialize, $options) { return new GCPServerStreamCall($channel, $method, $deserialize, $options); } public function BidiStreamingCall($channel, $method, $deserialize, $options) { return new GCPBidiStreamingCall($channel, $method, $deserialize, $options); } }