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

[breaking] Simplified gRPC streams helpers #1857

Merged
merged 2 commits into from
Sep 2, 2022

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Aug 31, 2022

Please check if the PR fulfills these requirements

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes/features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)

What kind of change does this PR introduce?
Simplifies the gRPC streams helpers: the Close method on the WriteCloser object, returned by the function FeedStreamTo, is now synchronized with the other side of the "pipe" and automatically waits for the messages to be flushed., there is no more need to explicitly wait.

What is the current behavior?
In theory, there should be no change in behavior.

What is the new behavior?
In practice, this PR may solve some very well hidden bugs.

Does this PR introduce a breaking change, and is titled accordingly?
Yes. The functions utils.FeedStreamTo and utils.ConsumeStreamFrom are now private.

@codecov
Copy link

codecov bot commented Aug 31, 2022

Codecov Report

Merging #1857 (d3efd13) into master (4a4d1fd) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master    #1857      +/-   ##
==========================================
- Coverage   36.58%   36.58%   -0.01%     
==========================================
  Files         231      231              
  Lines       19561    19564       +3     
==========================================
  Hits         7157     7157              
- Misses      11578    11581       +3     
  Partials      826      826              
Flag Coverage Δ
unit 36.58% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
commands/daemon/daemon.go 0.00% <0.00%> (ø)
commands/daemon/debug.go 0.00% <0.00%> (ø)
commands/daemon/stream.go 0.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@cmaglie cmaglie self-assigned this Sep 1, 2022
@cmaglie cmaglie added type: enhancement Proposed improvement topic: gRPC Related to the gRPC interface labels Sep 1, 2022
@per1234 per1234 added the topic: code Related to content of the project itself label Sep 1, 2022
Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

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

I tested it out by exercising the various stream gRPC interfaces via Arduino IDE 2.x and everything worked perfectly.

Thanks Cristian!

@cmaglie cmaglie changed the title [skip-changelog] Simplified gRPC streams helpers [breaking] Simplified gRPC streams helpers Sep 2, 2022
@cmaglie cmaglie merged commit 73b3b61 into arduino:master Sep 2, 2022
@cmaglie cmaglie deleted the simplify_grpc_streams branch September 2, 2022 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself topic: gRPC Related to the gRPC interface type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants