gRPC  0.6.0
 All Classes Namespaces Functions Variables Enumerations Properties Pages
Public Member Functions | List of all members
Grpc\BaseStub Class Reference

Public Member Functions

 __construct ($hostname, $opts)
 
 close ()
 
 _simpleRequest ($method, $argument, callable $deserialize, $metadata=array())
 
 _clientStreamRequest ($method, $arguments, callable $deserialize, $metadata=array())
 
 _serverStreamRequest ($method, $argument, callable $deserialize, $metadata=array())
 
 _bidiRequest ($method, callable $deserialize, $metadata=array())
 

Detailed Description

Base class for generated client stubs. Stub methods are expected to call _simpleRequest or _streamRequest and return the result.

Constructor & Destructor Documentation

Grpc\BaseStub::__construct (   $hostname,
  $opts 
)
Parameters
$hostnamestring
$optsarray
  • 'update_metadata': (optional) a callback function which takes in a metadata array, and returns an updated metadata array

Member Function Documentation

Grpc\BaseStub::_bidiRequest (   $method,
callable  $deserialize,
  $metadata = array() 
)

Call a remote method with messages streaming in both directions

Parameters
string$methodThe name of the method to call
callable$deserializeA function that deserializes the responses
array$metadataA metadata map to send to the server
Returns
BidiStreamingSurfaceActiveCall The active call object
Grpc\BaseStub::_clientStreamRequest (   $method,
  $arguments,
callable  $deserialize,
  $metadata = array() 
)

Call a remote method that takes a stream of arguments and has a single output

Parameters
string$methodThe name of the method to call
$argumentsAn array or Traversable of arguments to stream to the server
callable$deserializeA function that deserializes the response
array$metadataA metadata map to send to the server
Returns
ClientStreamingSurfaceActiveCall The active call object
Grpc\BaseStub::_serverStreamRequest (   $method,
  $argument,
callable  $deserialize,
  $metadata = array() 
)

Call a remote method that takes a single argument and returns a stream of responses

Parameters
string$methodThe name of the method to call
$argumentThe argument to the method
callable$deserializeA function that deserializes the responses
array$metadataA metadata map to send to the server
Returns
ServerStreamingSurfaceActiveCall The active call object
Grpc\BaseStub::_simpleRequest (   $method,
  $argument,
callable  $deserialize,
  $metadata = array() 
)

Call a remote method that takes a single argument and has a single output

Parameters
string$methodThe name of the method to call
$argumentThe argument to the method
callable$deserializeA function that deserializes the response
array$metadataA metadata map to send to the server
Returns
SimpleSurfaceActiveCall The active call object
Grpc\BaseStub::close ( )

Close the communication channel associated with this stub


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