Yoji Shidara
null+****@clear*****
Fri Oct 11 15:05:57 JST 2013
Yoji Shidara 2013-10-11 15:05:57 +0900 (Fri, 11 Oct 2013) New Revision: 79744ef9160652756e5131310ffa4d005d7bf268 https://github.com/droonga/fluent-plugin-droonga/commit/79744ef9160652756e5131310ffa4d005d7bf268 Message: Call publish method to publish Modified files: lib/droonga/plugin/handler_watch.rb Modified: lib/droonga/plugin/handler_watch.rb (+16 -3) =================================================================== --- lib/droonga/plugin/handler_watch.rb 2013-10-11 15:03:18 +0900 (5c6a0a0) +++ lib/droonga/plugin/handler_watch.rb 2013-10-11 15:05:57 +0900 (a1039e9) @@ -55,9 +55,7 @@ module Droonga values.each do |key, value| scan_body(hits, value) end - #publish(hits, request) - p [hits, request] - # TODO publish + publish(hits, request) end private @@ -144,5 +142,20 @@ module Droonga end end end + + def publish(hits, request) + routes = {} + hits.each do |query| + @context['User'].select do |user| + user.subscriptions =~ query + end.each do |user| + routes[user.route.key] ||= [] + routes[user.route.key] << user.key.key + end + end + routes.each do |route, users| + p [route, users, request] # TODO dispatch to correct destination + end + end end end -------------- next part -------------- HTML����������������������������...Download