Method: Analysand::ChangeWatcher#start

Defined in:
lib/analysand/change_watcher.rb

#startObject



137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# File 'lib/analysand/change_watcher.rb', line 137

def start
  return if @started

  @started = true

  while !connection_ok
    error "Some services used by #{self.class.name} did not check out ok; will retry in 30 seconds"
    sleep 30
  end

  connect

  info "#{self.class} entering read loop"

  @running = true

  while @running
    @http_parser << @socket.readpartial(QUANTUM)
  end

  # Once we're done, close things up.
  @started = false
  @socket.close
end