src/GcpExtensionChannel.php
public function watchConnectivityState($last_state, $deadline_obj = null)
    {
        if ($deadline_obj == null || !is_a($deadline_obj, '\Grpc\Timeval')) {
            throw new \InvalidArgumentException("");
        }
        // Since getRealChannel is creating a PHP Channel object. However in gRPC, when a Channel
        // object is closed, we only mark this Object to be invalid. Thus, we need a global variable
        // to mark whether this GCPExtensionChannel is close or not.
        if ($this->is_closed) {
            throw new \RuntimeException("Channel has already been closed");
        }
        $state = 0;
        foreach ($this->channel_refs as $channel_ref) {
            $state = $channel_ref->getRealChannel($this->credentials)->watchConnectivityState($last_state, $deadline_obj);
        }
        return $state;
    }
public function watchConnectivityState($last_state, $deadline_obj = null)
    {
        if ($deadline_obj == null || !is_a($deadline_obj, '\Grpc\Timeval')) {
            throw new \InvalidArgumentException("");
        }
        // Since getRealChannel is creating a PHP Channel object. However in gRPC, when a Channel
        // object is closed, we only mark this Object to be invalid. Thus, we need a global variable
        // to mark whether this GCPExtensionChannel is close or not.
        if ($this->is_closed) {
            throw new \RuntimeException("Channel has already been closed");
        }
        $state = 0;
        foreach ($this->channel_refs as $channel_ref) {
            $state = $channel_ref->getRealChannel($this->credentials)->watchConnectivityState($last_state, $deadline_obj);
        }
        return $state;
    }
public function watchConnectivityState ( $ last_state , $ deadline_obj = null ) { if ( $ deadline_obj == null || ! is_a ( $ deadline_obj , '\Grpc\Timeval' ) ) { throw new \ InvalidArgumentException ( "" ) ; } // Since getRealChannel is creating a PHP Channel object. However in gRPC, when a Channel // object is closed, we only mark this Object to be invalid. Thus, we need a global variable // to mark whether this GCPExtensionChannel is close or not. if ( $ this -> is_closed ) { throw new \ RuntimeException ( "Channel has already been closed" ) ; } $ state = 0 ; foreach ( $ this -> channel_refs as $ channel_ref ) { $ state = $ channel_ref -> getRealChannel ( $ this -> credentials ) -> watchConnectivityState ( $ last_state , $ deadline_obj ) ; } return $ state ; }
Watch the connectivity state of the channel until it changed

@param int     $last_state   The previous connectivity state of the channel
@param Timeval $deadline_obj The deadline this function should wait until

@return bool If the connectivity state changes from last_state
before deadline
@throws \InvalidArgumentException
Watch the connectivity state of the channel until it changed