Clients - grpc : Client

The gRPC client endpoint provides the capability for initiating contact with a remote gRPC service. The API it provides includes functions to send request/error messages.

blockingExecute

(string methodID, any payload, Headers? headers)

returns [any, Headers] | error

Calls when executing blocking call with gRPC service.

Parameters

  • methodID string
  • Remote service method id.

  • payload any
  • Request message. Message type varies with remote service method parameter.

  • headers Headers? - ()
  • Optional headers parameter. Passes header value if needed. Default sets to nil.

  • Return Type

    ([any, Headers] | error)
  • Returns response message and headers if executes successfully, error otherwise.

nonBlockingExecute

(string methodID, any payload, service listenerService, Headers? headers)

returns error?

Calls when executing non-blocking call with gRPC service.

Parameters

  • methodID string
  • Remote service method id.

  • payload any
  • Request message. Message type varies with remote service method parameter..

  • listenerService service
  • Call back listener service. This service listens the response message from service.

  • headers Headers? - ()
  • Optional headers parameter. Passes header value if needed. Default sets to nil.

  • Return Type

    (error?)
  • Returns an error if encounters an error while sending the request, returns nil otherwise.

streamingExecute

(string methodID, service listenerService, Headers? headers)

returns StreamingClient | error

Calls when executing streaming call with gRPC service.

Parameters

  • methodID string
  • Remote service method id.

  • listenerService service
  • Call back listener service. This service listens the response message from service.

  • headers Headers? - ()
  • Optional headers parameter. Passes header value if needed. Default sets to nil.

  • Return Type

    (StreamingClient | error)
  • Returns client connection if executes successfully, error otherwise.

initStub

(string stubType, string descriptorKey, map descriptorMap)

returns error?

Calls when initializing client endpoint with service descriptor data extracted from proto file.

Parameters

  • stubType string
  • Service Stub type. possible values: blocking, nonblocking.

  • descriptorKey string
  • Proto descriptor key. Key of proto descriptor.

  • descriptorMap map
  • Proto descriptor map. descriptor map with all dependent descriptors.

  • Return Type

    (error?)
  • Returns an error if encounters an error while initializing the stub, returns nill otherwise.