Clients -
grpc :
Caller
Provides the gRPC remote functions for interacting with 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
Returns the unique identification of the caller.
Checks whether the connection is closed by the caller.
Fields
Sends the outbound response to the caller.
grpc:Error? err = caller->send(message, headers);
Parameters
- res anydata
-
- The outbound response message
- headers Headers? (default <ballerina/grpc:Headers?> ())
-
- Optional headers parameter. The header values are passed only if needed. The default value is
()
- Optional headers parameter. The header values are passed only if needed. The default value is
-
Return Type
(Error?) - A
grpc:Error
if an error occurs while sending the response or else()
- A
Informs the caller, when the server has sent all the messages.
grpc:Error? result = caller->complete();
-
Return Type
(Error?) A
grpc:Error
if an error occurs while sending the response or else()
Sends a server error to the caller.
grpc:Error? result = caller->sendError(grpc:ABORTED, "Operation aborted", headers);
Parameters
- statusCode int
-
Error status code
- message string
-
Error message
- headers Headers? (default <ballerina/grpc:Headers?> ())
-
Optional headers parameter. The header values are passed only if needed. The default value is
()
-
Return Type
(Error?) A
grpc:Error
if an error occurs while sending the response or else()
Returns the unique identification of the caller.
int result = caller.getId();
-
Return Type
(int) caller ID