Class: ClickSession::WebRunnerProcessor

Inherits:
Object
  • Object
show all
Defined in:
lib/click_session/web_runner_processor.rb

Instance Method Summary collapse

Constructor Details

#initializeWebRunnerProcessor

Returns a new instance of WebRunnerProcessor.



5
6
7
8
# File 'lib/click_session/web_runner_processor.rb', line 5

def initialize
  @retries_made  = 0
  @making_requests = true
end

Instance Method Details

#process(model) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/click_session/web_runner_processor.rb', line 12

def process(model)
  while can_make_requests?
    begin
      run_steps_in_browser_with(model)
    rescue StandardError => e
      make_note_of_error(e)

      if too_many_retries?
        raise TooManyRetriesError.new
      end
    end
  end

  model
end

#stop_processingObject



28
29
30
# File 'lib/click_session/web_runner_processor.rb', line 28

def stop_processing
  @making_requests = false
end