synchros2.callback_groups module
- class synchros2.callback_groups.NonReentrantCallbackGroup[source]
Bases:
CallbackGroupA callback group to prevent concurrent execution of the same callback while allowing it for different callbacks.
Note this behavior sits in between that offered by rclpy.callback_groups.MutuallyExclusiveCallbackGroup and rclpy.callback_groups.ReentrantCallbackGroup, as the former forbids concurrent execution and the latter allows it including multiple invocations of the same callback (e.g. a subscription handling multiple messages concurrently).
See rclpy.callback_groups.CallbackGroup documentation for further reference.
- beginning_execution(entity: rclpy.executors.WaitableEntityType) bool[source]
Get permission for the callback from the group to begin executing an entity.
If this returns True then CallbackGroup.ending_execution must be called after the callback has been executed.
- Arg:
entity:A subscription, timer, client, service, or waitable instance.
- Returns:
True if the callback can be executed, False otherwise.