@restorecommerce/grpc-client v2.2.1
grpc-client
This module features:
- A Node.js gRPC client based on grpc
- Uses Protocol Buffers to describe both the service interface and the structure of the payload messages
- Failing endpoints are handled using a retry mechanism (see async-retry)
- The client's communication process is designed to support different types of middlewares and load balancing strategies such as
Random
andRoundRobin
.
Configuration
A client instance requires a configuration object and optionally a winston compatible logger. Configuration info should include transport-specific details (such as protobuf interfaces) and the names of the endpoints which it is aimed to connect to. For detailed grpc client configuration refer grpc_test.
Customization
Although the main transport is gRPC, the client's configuration options are flexible enough to support other transports, which would have to be implemented extending the Client class to handle that specific transport. The same is true for custom load balancers.
Development
Tests
For a simple example on how to use this client with a generic gRPC server check the test cases. The connect
method as well as all exposed RPC calls are async.
- To run tests
npm run test
Usage
- Install dependencies
npm install
- Build
# compile the code
npm run build
18 days ago
2 months ago
2 months ago
4 months ago
5 months ago
9 months ago
10 months ago
7 months ago
7 months ago
6 months ago
6 months ago
5 months ago
11 months ago
12 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago