Skip to content

Commit

Permalink
Use async style
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jan 27, 2014
1 parent 03f03de commit 408bf37
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions sample/droonga-request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,12 @@
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

0 comments on commit 408bf37

Please sign in to comment.