lib/grumlin/request_dispatcher.rb in grumlin-0.19.7 vs lib/grumlin/request_dispatcher.rb in grumlin-0.20.0
- old
+ new
@@ -36,11 +36,11 @@
def initialize
@requests = {}
end
def add_request(request)
- raise RequestAlreadyAddedError if @requests.key?(request[:requestId])
+ raise RequestAlreadyAddedError if @requests.include?(request[:requestId])
Async::Channel.new.tap do |channel|
@requests[request[:requestId]] = { request: request, result: [], channel: channel }
end
end
@@ -71,10 +71,10 @@
close_request(request_id)
end
end
def ongoing_request?(request_id)
- @requests.key?(request_id)
+ @requests.include?(request_id)
end
def clear
@requests.each do |_id, request|
request[:channel].close!