Class: Rclrb::ReentrantCallbackGroup

Inherits:
CallbackGroupBase show all
Defined in:
lib/rclrb/callback_group.rb

Overview

Callbacks in a reentrant group are executed in parallel in seperate threads.

Instance Method Summary collapse

Methods inherited from CallbackGroupBase

#add, #initialize

Constructor Details

This class inherits a constructor from Rclrb::CallbackGroupBase

Instance Method Details

#spin(wait_set = nil) ⇒ Object



24
25
26
27
28
29
# File 'lib/rclrb/callback_group.rb', line 24

def spin(wait_set = nil)
  Thread.new do
    threads = @members.map { |m| Thread.new { m.spin wait_set } }
    threads.each { |x| x.join }
  end
end