class Channel
More...
◆ __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 | $target | The hostname to associate with this channel |
array | $args_array | The arguments to pass to the 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_connect | Try 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_state | The previous connectivity state of the channel |
Timeval | $deadline_obj | The 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: