Class: Punchblock::Component::ComponentNode

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec-rayo.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ ComponentNode

Returns a new instance of ComponentNode.



23
24
25
26
27
28
29
# File 'lib/rspec-rayo.rb', line 23

def initialize(*args)
  super
  @event_queue = Queue.new
  register_event_handler do |event|
    @event_queue << event
  end
end

Instance Attribute Details

#event_queueObject

Returns the value of attribute event_queue.



21
22
23
# File 'lib/rspec-rayo.rb', line 21

def event_queue
  @event_queue
end

Instance Method Details

#next_event(timeout = nil) ⇒ Object



31
32
33
# File 'lib/rspec-rayo.rb', line 31

def next_event(timeout = nil)
  Timeout::timeout(timeout || $config['rayo_queue']['connection_timeout']) { event_queue.pop }
end