rpc_client
The RpcClient
is the object responsible for implementing the client-side of remote procedure calls. The client, like the server, is implemented using plugin based approach. The RpcClient
instance is available from micro.client
and is configured by the ClientFeature
. Inside of an RpcClient
we find the following properties:
Property | Description |
---|---|
| The request interceptor is responsible for transforming an RPC + request into the corresponding network calls |
| The call filters act as middle-ware. The middle-ware can implement features such as: logging and service discovery |
The RpcClient
provides a simple API consisting of only a single function (ignoring the plugin API). This function is named call
.
Code: The function signature of RpcClient.call
. We cover the extension functions, which provide a cleaner interface, later.
The RpcClient
will forward to the OutgoingCallFilter
s and OutgoingRequestInterceptor
s when call
is invoked.
Figure: Flow of call
Utilities
Several extension functions exist to make the use of RpcClient
easier.
Extension functions
Simplifies the interface by combining the RpcClient
and OutgoingRequestInterceptor
into a single object
Simplifies the interface by combining the ClientAndBackend
with authentication code
Types
ClientAndBackend
Fields | Description |
---|---|
| Reference to the |
| Reference to the |
AuthenticatedClient
Fields | Description |
---|---|
| Reference to the |
| Reference to the |
|
|
|
|
Last updated