Class: Punchblock::Component::ComponentNode
- Inherits:
-
Object
- Object
- Punchblock::Component::ComponentNode
- Defined in:
- lib/rspec-rayo.rb
Instance Attribute Summary collapse
-
#event_queue ⇒ Object
Returns the value of attribute event_queue.
Instance Method Summary collapse
-
#initialize(*args) ⇒ ComponentNode
constructor
A new instance of ComponentNode.
- #next_event(timeout = nil) ⇒ Object
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_queue ⇒ Object
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 |