Module: VSM::Runtime

Defined in:
lib/vsm/runtime.rb

Class Method Summary collapse

Class Method Details

.start(capsule, ports: []) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/vsm/runtime.rb', line 6

def self.start(capsule, ports: [])
  Async do |task|
    capsule.run
    ports.each do |p|
      p.egress_subscribe if p.respond_to?(:egress_subscribe)
      task.async { p.loop } if p.respond_to?(:loop)
    end
    task.sleep
  end
end