Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the client accept a server URL to connect to #49

Merged
merged 1 commit into from
May 27, 2024

Conversation

llucax
Copy link
Contributor

@llucax llucax commented May 24, 2024

This URL is a string with the form grpc://hostname[:<port:int=9090>][?ssl=<ssl:bool=false>], meaning that the port and ssl are optional and default to 9090 and false respectively.

This makes it more convenient to take server URLs from config files and enviroment variables, but it also means gRPC channels are not exposed directly to users anymore, so the internal implementation to connect to the gRPC server can be changed without it being a breaking change (we could potentially even change the protocol completely to use something else rather than gRPC).

@llucax llucax requested review from a team as code owners May 24, 2024 08:01
@github-actions github-actions bot added part:docs Affects the documentation part:tests Affects the unit, integration and performance (benchmarks) tests part:client Affects the client code labels May 24, 2024
@llucax llucax self-assigned this May 24, 2024
@llucax llucax added this to the v0.4.0 milestone May 24, 2024
@llucax llucax enabled auto-merge May 24, 2024 08:23
@llucax
Copy link
Contributor Author

llucax commented May 24, 2024

Enabling auto-merge.

Copy link

@daniel-zullo-frequenz daniel-zullo-frequenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a question and LGTM

src/frequenz/client/microgrid/_client.py Show resolved Hide resolved
@llucax llucax added the type:enhancement New feature or enhancement visitble to users label May 27, 2024
@llucax llucax linked an issue May 27, 2024 that may be closed by this pull request
@llucax llucax removed this from the v0.4.0 milestone May 27, 2024
This URL is a string with the form
`grpc://hostname[:<port:int=9090>][?ssl=<ssl:bool=false>]`, meaning that
the `port` and `ssl` are optional and default to 9090 and `false`
respectively.

This makes it more convenient to take server URLs from config files and
enviroment variables, but it also means gRPC channels are not exposed
directly to users anymore, so the internal implementation to connect to
the gRPC server can be changed without it being a breaking change (we
could potentially even change the protocol completely to use something
else rather than gRPC).

Signed-off-by: Leandro Lucarella <[email protected]>
@llucax llucax added this pull request to the merge queue May 27, 2024
Merged via the queue into frequenz-floss:v0.x.x with commit f410571 May 27, 2024
14 checks passed
@llucax llucax deleted the chan-str branch May 27, 2024 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
part:client Affects the client code part:docs Affects the documentation part:tests Affects the unit, integration and performance (benchmarks) tests type:enhancement New feature or enhancement visitble to users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use a connection string instead of a grpclib.client.Channel
2 participants