Kouhei Sutou
null+****@clear*****
Mon Jan 27 18:26:58 JST 2014
Kouhei Sutou 2014-01-27 18:26:58 +0900 (Mon, 27 Jan 2014) New Revision: 408bf370c4d9c2e3edd805f19ef008f77707918e https://github.com/droonga/droonga-client-ruby/commit/408bf370c4d9c2e3edd805f19ef008f77707918e Message: Use async style Modified files: sample/droonga-request.rb Modified: sample/droonga-request.rb (+8 -6) =================================================================== --- sample/droonga-request.rb 2014-01-27 18:25:35 +0900 (6c4ae62) +++ sample/droonga-request.rb 2014-01-27 18:26:58 +0900 (144f028) @@ -83,10 +83,12 @@ end request_json_file = rest.first client = Droonga::Client.new(options) -request = JSON.parse(File.read(request_json_file)) -response = client.request(request) -begin - puts(JSON.pretty_generate(response)) -rescue - p(response) +request_message = JSON.parse(File.read(request_json_file)) +request = client.request(request_message) do |response| + begin + puts(JSON.pretty_generate(response)) + rescue + p(response) + end end +request.wait -------------- next part -------------- HTML����������������������������... Download