Closed llucax closed 5 months ago
Actually marking as draft because it depends on #54.
FYI, I'm planning to add support to easily wrap stub methods having automatic retry using retry strategies, and to have also an easy way to wrap streaming methods by having a list of GrpcStreamBroadcaster
internally, which is something every client having streaming methods need to do. All of this in follow-up PRs, not this one, but just so you know where is this heading.
This class abstracts the common functionality of all the API clients. It provides a way to connect and disconnect from the server, provided as a URL, and a way to create the stubs to interact with the server.
It also provides an async context manager to make sure the connection is closed when the client is done.
We also add a new
ClientNotConnected
exception that is raised when performing operation on a client that is not connected to the server.