-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
API context propagation #85
Conversation
This change will allow executing commands to be canceled right away if request is canceled.
Small demo :^) Screen.Recording.2025-01-13.145900.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR!
What is with following commands reusing the same connection? The cancle would not work for them.
…onse And not always, even if response is missing
Context is based for each command on its own. If first command succeedes inside its allowed deadline, it will call TeslaBleHttpProxy/internal/ble/control/control.go Lines 284 to 292 in 499b868
|
Thanks, the last Commit was very important. Hope this is fine with you. |
This pull request includes several changes to improve context handling and (and little logging). The most important changes include adding context propagation to API responses, introducing a logging function to show request details, and simplifying error handling in BLE control operations.
This PR will most importantly allow stopping command execution quickly if request is canceled. This will speed up queue processingby quite a bit if there is a lot of canceled requests and so prevent the queue from growing.