> For the complete documentation index, see [llms.txt](https://www.learnros2.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.learnros2.com/ros/cookbook/how-to-spin-nodes.md).

# How to spin nodes

There two ways to spin nodes:

* use `rclcpp::spin`
* create an executor, add nodes to the executor, and then call the `spin` method of the executor.
