PHP Класс Grpc\BaseStub

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( $hostname, $opts, $channel = null )
_bidiRequest ( string $method, callable $deserialize, array $metadata = [], $options = [] ) : grpc\BidiStreamingSurfaceActiveCall Call a remote method with messages streaming in both directions.
_clientStreamRequest ( string $method, callable $deserialize, array $metadata = [], $options = [] ) : grpc\ClientStreamingSurfaceActiveCall Call a remote method that takes a stream of arguments and has a single output.
_serverStreamRequest ( string $method, mixed $argument, callable $deserialize, array $metadata = [], $options = [] ) : grpc\ServerStreamingSurfaceActiveCall Call a remote method that takes a single argument and returns a stream of responses.
_simpleRequest ( string $method, mixed $argument, callable $deserialize, array $metadata = [], $options = [] ) : grpc\SimpleSurfaceActiveCall Call a remote method that takes a single argument and has a single output.
close ( ) Close the communication channel associated with this stub.
getConnectivityState ( $try_to_connect = false ) : integer
getTarget ( ) : string
waitForReady ( integer $timeout ) : boolean

Приватные методы

Метод Описание
_checkConnectivityState ( $new_state )
_get_jwt_aud_uri ( $method ) constructs the auth uri for the jwt.
_validate_and_normalize_metadata ( array $metadata ) validate and normalize the metadata array.

Описание методов

__construct() публичный Метод

public __construct ( $hostname, $opts, $channel = null )
$hostname string
$opts array - 'update_metadata': (optional) a callback function which takes in a metadata array, and returns an updated metadata array - 'grpc.primary_user_agent': (optional) a user-agent string
$channel Channel An already created Channel object

_bidiRequest() публичный Метод

Call a remote method with messages streaming in both directions.
public _bidiRequest ( string $method, callable $deserialize, array $metadata = [], $options = [] ) : grpc\BidiStreamingSurfaceActiveCall
$method string The name of the method to call
$deserialize callable A function that deserializes the responses
$metadata array A metadata map to send to the server
Результат grpc\BidiStreamingSurfaceActiveCall The active call object

_clientStreamRequest() публичный Метод

Call a remote method that takes a stream of arguments and has a single output.
public _clientStreamRequest ( string $method, callable $deserialize, array $metadata = [], $options = [] ) : grpc\ClientStreamingSurfaceActiveCall
$method string The name of the method to call
$deserialize callable A function that deserializes the response
$metadata array A metadata map to send to the server
Результат grpc\ClientStreamingSurfaceActiveCall The active call object

_serverStreamRequest() публичный Метод

Call a remote method that takes a single argument and returns a stream of responses.
public _serverStreamRequest ( string $method, mixed $argument, callable $deserialize, array $metadata = [], $options = [] ) : grpc\ServerStreamingSurfaceActiveCall
$method string The name of the method to call
$argument mixed The argument to the method
$deserialize callable A function that deserializes the responses
$metadata array A metadata map to send to the server
Результат grpc\ServerStreamingSurfaceActiveCall The active call object

_simpleRequest() публичный Метод

Call a remote method that takes a single argument and has a single output.
public _simpleRequest ( string $method, mixed $argument, callable $deserialize, array $metadata = [], $options = [] ) : grpc\SimpleSurfaceActiveCall
$method string The name of the method to call
$argument mixed The argument to the method
$deserialize callable A function that deserializes the response
$metadata array A metadata map to send to the server
Результат grpc\SimpleSurfaceActiveCall The active call object

close() публичный Метод

Close the communication channel associated with this stub.
public close ( )

getConnectivityState() публичный Метод

public getConnectivityState ( $try_to_connect = false ) : integer
$try_to_connect bool
Результат integer The grpc connectivity state

getTarget() публичный Метод

public getTarget ( ) : string
Результат string The URI of the endpoint.

waitForReady() публичный Метод

public waitForReady ( integer $timeout ) : boolean
$timeout integer in microseconds
Результат boolean true if channel is ready