GRPC PHP  1.62.0
Public Member Functions
Grpc\Channel Class Reference

class Channel More...

Public Member Functions

 __construct ($target, $args_array)
 Construct an instance of the Channel class. More...
 
 getTarget ()
 Get the endpoint this call/stream is connected to. More...
 
 getConnectivityState ($try_to_connect)
 Get the connectivity state of the channel. More...
 
 watchConnectivityState ($last_state, $deadline_obj)
 Watch the connectivity state of the channel until it changed. More...
 
 close ()
 Close the channel. More...
 

Detailed Description

class Channel

See also
https://github.com/grpc/grpc/tree/master/src/php/ext/grpc/channel.c

Constructor & Destructor Documentation

◆ __construct()

Grpc\Channel::__construct (   $target,
  $args_array 
)

Construct an instance of the Channel class.

By default, the underlying grpc_channel is "persistent". That is, given the same set of parameters passed to the constructor, the same underlying grpc_channel will be returned.

If the $args array contains a "credentials" key mapping to a ChannelCredentials object, a secure channel will be created with those credentials.

If the $args array contains a "force_new" key mapping to a boolean value of "true", a new and separate underlying grpc_channel will be created and returned. This will not affect existing channels.

Parameters
string$targetThe hostname to associate with this channel
array$args_arrayThe arguments to pass to the Channel

Member Function Documentation

◆ close()

Grpc\Channel::close ( )

Close the channel.

Returns
void

◆ getConnectivityState()

Grpc\Channel::getConnectivityState (   $try_to_connect)

Get the connectivity state of the channel.

Parameters
bool$try_to_connectTry to connect on the channel (optional)
Returns
long The grpc connectivity state

◆ getTarget()

Grpc\Channel::getTarget ( )

Get the endpoint this call/stream is connected to.

Returns
string The URI of the endpoint

◆ watchConnectivityState()

Grpc\Channel::watchConnectivityState (   $last_state,
  $deadline_obj 
)

Watch the connectivity state of the channel until it changed.

Parameters
long$last_stateThe previous connectivity state of the channel
Timeval$deadline_objThe deadline this function should wait until
Returns
bool If the connectivity state changes from last_state before deadline

The documentation for this class was generated from the following file: