Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

feature: Added gRPC close signal to Monitor call (allows graceful close of monitor) #2276

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

Merged
merged 9 commits into from
Jan 2, 2024
Prev Previous commit
Next Next commit
Added Close request to gRPC Monitor API
  • Loading branch information
cmaglie committed Jan 2, 2024
commit 9c59c34ab8d3e846151f7ec12301f9af41a773ec
5 changes: 5 additions & 0 deletions 5 commands/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,11 @@ func (s *ArduinoCoreServerImpl) Monitor(stream rpc.ArduinoCoreService_MonitorSer
}
}
}
if close := msg.GetClose(); close {
if err := portProxy.Close(); err != nil {
logrus.WithError(err).Debug("Error closing monitor port")
}
}
tx := msg.GetTxData()
for len(tx) > 0 {
n, err := portProxy.Write(tx)
Expand Down
168 changes: 94 additions & 74 deletions 168 rpc/cc/arduino/cli/commands/v1/monitor.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions 4 rpc/cc/arduino/cli/commands/v1/monitor.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ message MonitorRequest {
bytes tx_data = 2;
// Port configuration, contains settings of the port to be changed
MonitorPortConfiguration updated_configuration = 3;
// Close message, set to true to gracefully close a port (this ensure
// that the gRPC streaming call is closed by the daemon AFTER the port
// has been successfully closed)
bool close = 4;
}
}

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.