Skip to content

Commit

Permalink
Prepare to distribute multiple messages
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Jan 24, 2014
1 parent 08f59f0 commit 6b9198f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/droonga/distributor_plugin.rb
Expand Up @@ -31,28 +31,30 @@ def distribute(message)
end

def scatter_all(message, key)
distribute_message = [{
distribute_message = {
"command"=> message["type"],
"dataset"=> message["dataset"],
"body"=> message["body"],
"key"=> key,
"type"=> "scatter",
"replica"=> "all",
"post"=> true
}]
distribute(distribute_message)
}
messages = [distribute_message]
distribute(messages)
end

def broadcast_all(message)
distribute_message = [{
distribute_message = {
"command"=> message["type"],
"dataset"=> message["dataset"],
"body"=> message["body"],
"type"=> "broadcast",
"replica"=> "all",
"post"=> true
}]
distribute(distribute_message)
}
messages = [distribute_message]
distribute(messages)
end

private
Expand Down

0 comments on commit 6b9198f

Please sign in to comment.