-
Notifications
You must be signed in to change notification settings - Fork 79
feat: add promise-based service calls #1311
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
feat: add promise-based service calls #1311
Conversation
59cf513 to
ae08f65
Compare
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.
Pull Request Overview
This PR adds promise-based service calls to the rclnodejs library through a new sendRequestAsync() method, providing modern async/await patterns as an alternative to the existing callback-based sendRequest() method.
Key changes:
- Added
sendRequestAsync()method to the Client class with timeout and cancellation support - Comprehensive test coverage for the new async functionality
- Documentation and examples demonstrating usage patterns
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| lib/client.js | Implements sendRequestAsync() method with Promise-based API, timeout handling, and AbortSignal support; also fixes typos in existing documentation |
| test/test-async-client.js | Comprehensive test suite covering all aspects of async client functionality including timeouts, cancellation, concurrent requests, and error handling |
| example/services/client/async-client-example.js | Example demonstrating basic usage of the new async client API |
| example/services/README.md | Documentation updates explaining the new async API, usage patterns, and differences from callback-based approach |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
@mahmoudalghalayini thanks for submitting the PR, just a comment about the parameter used for the added function. BTW, please feel free to add your name into CONTRIBUTORS
ae08f65 to
b957ff4
Compare
b957ff4 to
6d1e681
Compare
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.
LGTM, thanks for your PR!
|
@mahmoud-ghalayini I have approved, please add some description when merging, thanks! |
Description is added, but I don't have merge right 😄 |
@mahmoud-ghalayini I have added you as collaborator, please check your email inbox to see any invitation received. |
#1310