Class: Chordate::Runner::Event

Inherits:
Object
  • Object
show all
Includes:
Celluloid
Defined in:
lib/chordate-ruby/runner/event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEvent



10
11
12
13
# File 'lib/chordate-ruby/runner/event.rb', line 10

def initialize
  @errors = []
  @exit = false
end

Instance Attribute Details

#errorsObject (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

#exitObject



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

#startObject



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