2.2.1 • Published 18 days ago

@restorecommerce/grpc-client v2.2.1

Weekly downloads
247
License
MIT
Repository
github
Last release
18 days ago

grpc-client

VersionBuild StatusDependenciesCoverage Status

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 and RoundRobin.

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
2.2.1

18 days ago

2.2.0

2 months ago

2.1.2

2 months ago

2.1.1

4 months ago

2.1.0

5 months ago

2.0.3

9 months ago

2.0.2

10 months ago

2.0.5

7 months ago

2.0.4

7 months ago

2.0.7

6 months ago

2.0.6

6 months ago

2.0.8

5 months ago

2.0.1

11 months ago

2.0.0

12 months ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.3

2 years ago

1.0.0

2 years ago

0.4.5

2 years ago

0.4.4

2 years ago

0.4.6

2 years ago

0.4.3

2 years ago

0.4.2

2 years ago

0.4.1

2 years ago

0.3.2

2 years ago

0.4.0

2 years ago

0.3.0

2 years ago

0.3.1

2 years ago

0.2.14

2 years ago

0.2.13

2 years ago

0.2.12

2 years ago

0.2.10

3 years ago

0.2.9

3 years ago

0.2.8

3 years ago

0.2.7

3 years ago

0.2.6

3 years ago

0.2.4

3 years ago

0.1.0

3 years ago

0.2.3

3 years ago

0.2.1

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.3

4 years ago

0.0.4

4 years ago

0.0.2

4 years ago

0.0.1

5 years ago