Skip to content

Commit

Permalink
Isolate Engine from NodeMetadata
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Apr 21, 2015
1 parent 09334e6 commit 99512e9
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions lib/droonga/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
require "droonga/cluster"
require "droonga/catalog/loader"
require "droonga/dispatcher"
require "droonga/node_metadata"

module Droonga
class Engine
Expand All @@ -35,21 +34,17 @@ def initialize(loop, name, internal_name)
@name = name
@loop = loop
@catalog = load_catalog
@node_metadata = NodeMetadata.new
@state = EngineState.new(loop, name,
internal_name,
:catalog => @catalog,
:metadata => @node_metadata)
:catalog => @catalog)
@cluster = Cluster.new(loop,
:catalog => @catalog,
:metadata => @node_metadata)
:catalog => @catalog)

@dispatcher = create_dispatcher
end

def start
logger.trace("start: start")
@node_metadata.start_observe(@loop)
@state.on_ready = lambda do
on_ready
end
Expand All @@ -64,7 +59,6 @@ def start

def stop_gracefully
logger.trace("stop_gracefully: start")
@node_metadata.stop_observe
@cluster.shutdown
on_finish = lambda do
logger.trace("stop_gracefully/on_finish: start")
Expand Down

0 comments on commit 99512e9

Please sign in to comment.