ros2 / ros2/rclcpp

Executor::spin_some, spin_all, spin_once are odd function names

Open
#2,311 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
805
Forks
564
Avg merge
1d 17h
Merged PRs (30d)
27

Description

Executor::spin_some, Executor::spin_all and Executor::spin_once are odd function names, as they do not give a good idea of what the functions intention is. Multiple developers in my company ran into this issue, and used the wrong functions for their use case, especially spin_some and spin_all are confusing.
Therefore I would vote to deprecate these and replace them by

something like :


void execute_all_ready_events();
void execute_one_ready_event();
void execute_all_ready_events_for();
void execute_all_ready_events_until();

void execute_for();
void execute_until();

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the Executor::spin_some, Executor::spin_all, and Executor::spin_once declarations and their call sites. The issue does not name files, tests, or a settled replacement API, so first establish the accepted naming and deprecation scope. Done means the API direction is agreed and the affected interfaces and uses are consistently migrated.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend-api-design
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.