dgraph.net icon indicating copy to clipboard operation
dgraph.net copied to clipboard

gRPC client factory integration

Open czimpi opened this issue 4 years ago • 2 comments

Currently the DgraphClient class only exposes a constructor accepting gRPC channels, which will then be used to create the gRPC clients. These channels have to be manually mantained (lifetime, etc.) which may lead to misuses (e.g. gRPC channels should not be created for each new request but rather reused, see docs).

Using the gRPC client factory integration is an alternative approach to outsource the maintenance of the channel respectively the client. To use this approach, the DgraphClient class must accept the gRPC client directly rather than channels.

The current implementation does add the client from the constructor to the list of clients which are subject to the (currently not active) dispose logic. This should not be a problem, as the logic is currently inactive, but in the future this might be an issue, as the client's lifetime management should be managed by the client factory. I personally would also remove the inactive dispose logic and leave the channel lifetime management to the caller of the DgraphClient.

czimpi avatar Jul 17 '21 11:07 czimpi

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Jul 17 '21 11:07 CLAassistant

@czimpi can you update this PR and also sign the CLA?

MichelDiz avatar Apr 15 '23 03:04 MichelDiz

This PR has been stale for 60 days and will be closed automatically in 7 days. Comment to keep it open.

github-actions[bot] avatar Jul 11 '24 01:07 github-actions[bot]