class GrpcTransport extends BaseStub implements TransportInterface

A gRPC based transport implementation.

Traits

Provides helper methods for gRPC support.
Provides helper methods for service address handling.

Methods

static array
validate(array $arr, array $requiredKeys)

No description

static array
validateNotNull(array $arr, array $requiredKeys)

No description

__construct(string $hostname, array $opts, Channel $channel = null, array $interceptors = [])

No description

static GrpcTransport
build(string $serviceAddress, array $config = [])

Builds a GrpcTransport.

startBidiStreamingCall(Call $call, array $options)

Starts a bidi streaming call.

startClientStreamingCall(Call $call, array $options)

Starts a client streaming call.

startServerStreamingCall(Call $call, array $options)

Starts a server streaming call.

_simpleRequest($method, $argument, $deserialize, array $metadata = [], array $options = [])

No description

PromiseInterface
startUnaryCall(Call $call, array $options)

Returns a promise used to execute network requests.

Details

in ValidationTrait at line 41
static array validate(array $arr, array $requiredKeys)

Parameters

array $arr Associative array
array $requiredKeys List of keys to check for in $arr

Return Value

array Returns $arr for fluent use

in ValidationTrait at line 51
static array validateNotNull(array $arr, array $requiredKeys)

Parameters

array $arr Associative array
array $requiredKeys List of keys to check for in $arr

Return Value

array Returns $arr for fluent use

at line 74
__construct(string $hostname, array $opts, Channel $channel = null, array $interceptors = [])

Parameters

string $hostname
array $opts
  • '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 (optional)
array $interceptors EXPERIMENTAL Interceptor support, required until gRPC interceptors are available.

at line 97
static GrpcTransport build(string $serviceAddress, array $config = [])

Builds a GrpcTransport.

Parameters

string $serviceAddress The address of the API remote host, for example "example.googleapis.com. May also include the port, for example "example.googleapis.com:443"
array $config { Config options used to construct the gRPC transport.

@type array $stubOpts Options used to construct the gRPC stub. @type Channel $channel Grpc channel to be used. @type UnaryInterceptorInterface[] $interceptors EXPERIMENTAL Interceptor support, required until gRPC interceptors are available. }

Return Value

GrpcTransport

Exceptions

ValidationException

at line 134
BidiStream startBidiStreamingCall(Call $call, array $options)

Starts a bidi streaming call.

Parameters

Call $call
array $options

Return Value

BidiStream

at line 150
ClientStream startClientStreamingCall(Call $call, array $options)

Starts a client streaming call.

Parameters

Call $call
array $options

Return Value

ClientStream

at line 166
ServerStream startServerStreamingCall(Call $call, array $options)

Starts a server streaming call.

Parameters

Call $call
array $options

Return Value

ServerStream

at line 201
protected _simpleRequest($method, $argument, $deserialize, array $metadata = [], array $options = [])

Parameters

$method
$argument
$deserialize
array $metadata
array $options

at line 228
PromiseInterface startUnaryCall(Call $call, array $options)

Returns a promise used to execute network requests.

Parameters

Call $call
array $options

Return Value

PromiseInterface