Client: Caller

The base client used in the generated client code to provide remote functions for interacting with the caller.

Remote Methods

send

Sends the outbound response to the caller.

complete

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

sendError

Sends a server error to the caller.

Methods

getId

Returns the unique identification of the caller.

isCancelled

Checks whether the connection is closed by the caller.

Fields

  • remoteDetails Remote(default {})
  • The remote details

  • local Local(default {})
  • The local details

send

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

Sends the outbound response to the caller.

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

Parameters

  • res anydata
    • The outbound response 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 caller, when the server has sent all the messages.

1grpc:Error? result = caller->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 a server error to the caller.

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

Parameters

  • err Error
  • Error instance.

Return Type

(Error?)

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

getId

function getId() returns int
Isolated Function

Returns the unique identification of the caller.

1int result = caller.getId();

Return Type

(int)

caller ID

isCancelled

function isCancelled() returns boolean
Isolated Function

Checks whether the connection is closed by the caller.

1boolean result = caller.isCancelled();

Return Type

(boolean)

True if the caller has already closed the connection or else false