Last active
August 29, 2015 14:11
-
-
Save piroor/a5f5453449c8a4643b2b to your computer and use it in GitHub Desktop.
Droongaの分散処理を支える技術:通信プロトコル ref: http://qiita.com/piroor/items/2ca1e722c1bc48b17fce
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": 01234, | |
"type": "select", | |
"date": "2014-12-16T00:00:00Z", | |
"from": "client0:10031/droonga", | |
"replyTo": "client0:10031/droonga", | |
"dataset": "Default", | |
"body": { "table": "Stores", | |
"output_columns": "name", | |
"limit": 10 } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": 56789, | |
"type": "select.result", | |
"date": "2014-12-16T00:00:01Z", | |
"from": "node1:10031/droonga", | |
"inReplyTo": 01234, | |
"dataset": "Default", | |
"body": [ | |
[0, 1401358896.360356, 0.0035653114318847656], | |
[ | |
[ | |
[40], | |
[["name", "ShortText" ]], | |
["1st Avenue & 75th St. - New York NY (W)"], | |
["76th & Second - New York NY (W)"], | |
["Herald Square- Macy's - New York NY"], | |
["Macy's 5th Floor - Herald Square - New York NY (W)"], | |
["80th & York - New York NY (W)"], | |
["Columbus @ 67th - New York NY (W)"], | |
["45th & Broadway - New York NY (W)"], | |
["Marriott Marquis - Lobby - New York NY"], | |
["Second @ 81st - New York NY (W)"], | |
["52nd & Seventh - New York NY (W)"] | |
] | |
] | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "droonga-client" | |
client = Droonga::Client.new( | |
:host => "node0", | |
:port => 10031, | |
:tag => "droogna", | |
:protocol => :droonga, | |
:timeout => 1, | |
:receiver_host => "client0", | |
:receiver_port => 0, | |
) | |
request_message = { | |
"dataset" => "Default", | |
"type" => "select", | |
... | |
} | |
response_message = client.request(request_message) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment