Google API Core Client - Class BidiStream (1.36.0)

Reference documentation and code samples for the Google API Core Client class BidiStream.

BidiStream is the response object from a gRPC bidirectional streaming API call.

Namespace

Google \ ApiCore

Methods

__construct

BidiStream constructor.

Parameters
Name Description
bidiStreamingCall Grpc\BidiStreamingCall

The gRPC bidirectional streaming call object

streamingDescriptor array
logger null|Psr\Log\LoggerInterface

write

Write request to the server.

Parameter
Name Description
request mixed

The request to write

writeAll

Write all requests in $requests.

Parameter
Name Description
requests iterable

An Iterable of request objects to write to the server

closeWrite

Inform the server that no more requests will be written. The write() function cannot be called after closeWrite() is called.

read

Read the next response from the server. Returns null if the streaming call completed successfully. Throws an ApiException if the streaming call failed.

Returns
Type Description
mixed

closeWriteAndReadAll

Call closeWrite(), and read all responses from the server, until the streaming call is completed. Throws an ApiException if the streaming call failed.

Returns
Type Description
Generator|array

getBidiStreamingCall

Return the underlying gRPC call object

Returns
Type Description
Grpc\BidiStreamingCall|mixed