Skip to content

Commit

Permalink
Extracted the block of code to create method prepare_for_next_request…
Browse files Browse the repository at this point in the history
…() in queue_based_implementation_runner.rb
  • Loading branch information
neomatrix369 committed Oct 30, 2018
1 parent c3abe53 commit 517986b
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lib/tdl/queue/queue_based_implementation_runner.rb
Expand Up @@ -66,11 +66,7 @@ def process_next_request_from(remote_broker, request)

@audit.end_line

if response.instance_of? FatalErrorResponse
remote_broker.close
else
# Do nothing
end
prepare_for_next_request(remote_broker, response)
end

def after_response(remote_broker, request, response)
Expand All @@ -80,6 +76,14 @@ def after_response(remote_broker, request, response)
remote_broker.respond_to(request, response)
end
end

def prepare_for_next_request(remote_broker, response)
if response.instance_of? FatalErrorResponse
remote_broker.close
else
# Do nothing
end
end
end
end
end
Expand Down

0 comments on commit 517986b

Please sign in to comment.