Client: StreamingClient

The base client used in the generated client code to provide the gRPC streaming client actions for interacting with the gRPC server.

Remote Methods

send

Sends the request message to the server.

complete

Informs the server when the caller has sent all the messages.

sendError

Sends an error message to the server.

receive

Receives server responses in client streaming and bidirectional streaming.

send

function send(anydata res) returns Error?
Isolated Function
Remote Function

Sends the request message to the server.

1grpc:Error? err = sClient->send(message);

Parameters

  • res anydata
  • The inbound request message

Return Type

(Error?)

A grpc:Error if an error occurs while sending the response or else ()

complete

function complete() returns Error?
Isolated Function
Remote Function

Informs the server when the caller has sent all the messages.

1grpc:Error? result = sClient->complete();

Return Type

(Error?)

A grpc:Error if an error occurs while sending the response or else ()

sendError

function sendError(Error err) returns Error?
Isolated Function
Remote Function

Sends an error message to the server.

1grpc:Error? result = sClient->sendError(error grpc:AbortedError("Operation aborted"));

Parameters

Return Type

(Error?)

A grpc:Error if an error occurs while sending the response or else ()

receive

function receive() returns [anydata, map<string | string[ ]>] | Error?
Isolated Function
Remote Function

Receives server responses in client streaming and bidirectional streaming.

1anydata|grpc:Error? result = streamingClient->receive();

Return Type

([anydata, map<string | string[ ]>] | Error?)

An anydata value