Working Model - AkashBabu/lib-grpc-client-pool GitHub Wiki

Connection Creation

A new connection to gRPC-Server is created when all the older connection are in BUSY(reserved) state until the number of connections in the pool reaches a maximum of MaxConns limit, thereafter every new Request will have to wait at-least till a connection is FREE(released back to the pool) state. But once a connection is created, it will not be terminated even if there is no sufficient traffic (will be fixed in future releases)

Connection states

Currently there are only 2 connection states maintained viz:

  • FREE - This is the normal state of a connection
  • BUSY - This is used to reserve a connection in the pool

Abstraction of methods

This library provides an easier way to segregate RPC Namespaces w.r.t the rest of the namespaces and hence improving Readability.
Every gRPC Methods is wrapped over a function that takes care of connection pooling. Hence leaving the user with the same code/usage as before