Merged
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Contributor
Author
|
#54 merged, this is ready for review. I enabled auto-merge. |
Contributor
Author
|
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 |
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. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
This exception will be raised when making operations on the client that is not connected to the server. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
When the client is not connected there is no `stub` or `channel` that can be retrieved, so we raise an exception instead of returning `None`. This is much more convenient, as otherwise one must `assert is not None` each time those properties are used, and most of the time one will use them when it is expected that the client is connected. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Marenz
approved these changes
Jun 3, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
ClientNotConnectedexception that is raised when performing operation on a client that is not connected to the server.