Introduce GrpcStreamBroadcaster to enable keep_alive options#154
Merged
flora-hofmann-frequenz merged 1 commit intofrequenz-floss:v0.x.xfrom Mar 28, 2025
Conversation
Signed-off-by: Flora <flora.hofmann@frequenz.com>
3ac5b3a to
09d5ca0
Compare
cwasicki
approved these changes
Mar 27, 2025
Contributor
cwasicki
left a comment
There was a problem hiding this comment.
Thank you @flora-hofmann-frequenz !
| except grpcaio.AioRpcError as e: | ||
| print(f"RPC failed: {e}") | ||
| return | ||
| receiver = broadcaster.new_receiver() |
Contributor
There was a problem hiding this comment.
Oh, we get a receiver here. We can have two methods, one returning an iterator as we have now, another returning a receiver. That would be useful for you, correct @phillip-wenig-frequenz ?
Can be a subsequent PR though.
Contributor
Author
There was a problem hiding this comment.
Will add it in a follow up PR! (Issue #155)
Contributor
There was a problem hiding this comment.
Actually you just need a function that returns a receiver, because the receiver is already an iterator.
| retry_strategy=None, | ||
| ) | ||
|
|
||
| receiver = broadcaster.new_receiver() |
Contributor
There was a problem hiding this comment.
Same comment about the receiver method as above.
Closed
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.
After a sensitivity analysis, the default
ChannelOptions()of the base client are used (with the option to change them), as even with different configurations ofKeepAliveOptions()ofintervalandtimeout, the client sometimes has to retry.