Service callback without shared pointer
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 805
- Forks
- 564
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 27
Description
Would it be a good idea to support a service callback with a const reference and reference for services? At least for the overload without the request id.
Many services are able to return immediately and does not need the request/response object lifetime to exceed the call site. In general, it's also much cheaper to copy a small struct instead of doing atomic increments/decrements of shared pointers.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with rclcpp/include/rclcpp/any_service_callback.hpp at lines 209-238 and inspect the existing service callback overloads, especially the overload without a request id. Determine the API and lifetime requirements for const-reference and reference callbacks, then define tests showing the intended overloads and callback behavior before implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100