Class: Chordate::Runner::Event
- Inherits:
-
Object
- Object
- Chordate::Runner::Event
- Includes:
- Celluloid
- Defined in:
- lib/chordate-ruby/runner/event.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
- #exit ⇒ Object
- #exit? ⇒ Boolean
-
#initialize ⇒ Event
constructor
A new instance of Event.
- #push(e) ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize ⇒ Event
10 11 12 13 |
# File 'lib/chordate-ruby/runner/event.rb', line 10 def initialize @errors = [] @exit = false end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
8 9 10 |
# File 'lib/chordate-ruby/runner/event.rb', line 8 def errors @errors end |
Instance Method Details
#exit ⇒ Object
31 32 33 |
# File 'lib/chordate-ruby/runner/event.rb', line 31 def exit @exit = true end |
#exit? ⇒ Boolean
35 36 37 |
# File 'lib/chordate-ruby/runner/event.rb', line 35 def exit? @exit end |
#push(e) ⇒ Object
27 28 29 |
# File 'lib/chordate-ruby/runner/event.rb', line 27 def push(e) @errors << e end |
#start ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/chordate-ruby/runner/event.rb', line 15 def start if errors.any? HTTP.post(:events, :batch => errors) @errors = [] end return if exit? after(5) { start } end |