lib/client/ws_client.rb in scale_rb-0.3.5 vs lib/client/ws_client.rb in scale_rb-0.4.0
- old
+ new
@@ -20,11 +20,11 @@
recv_task = Async do
while (message = client.read_message)
data = parse_message(message)
next if data.nil?
- ScaleRb.logger.debug "Received response: #{data}"
+ ScaleRb.logger.debug "Response: #{data}"
Async do
client.handle_response(data)
end
end
end
@@ -69,11 +69,11 @@
@supported_methods.include?(method.to_s)
end
def method_missing(method, *args)
method = method.to_s
- ScaleRb.logger.debug "#{method}(#{args.join(', ')})"
+ # ScaleRb.logger.debug "#{method}(#{args.join(', ')})"
# why not check 'rpc_methods', because there is no @supported_methods when initializing
if method != 'rpc_methods' && !@supported_methods.include?(method)
raise "Method `#{method}` is not supported. It should be in [#{@supported_methods.join(', ')}]."
end
@@ -140,10 +140,10 @@
@response_handler.register(@request_id, proc { |response|
response_future.signal(response[:result])
})
request = { jsonrpc: '2.0', id: @request_id, method: method, params: params }
- ScaleRb.logger.debug "Sending request: #{request}"
+ ScaleRb.logger.debug "Request: #{request}"
@connection.write(request.to_json)
@request_id += 1
response_future.wait
end