Class: Droonga::Partition
- Inherits:
-
Object
- Object
- Droonga::Partition
- Defined in:
- lib/droonga/partition.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Partition
constructor
A new instance of Partition.
- #process(envelope, synchronous = nil) ⇒ Object
- #shutdown ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Partition
Returns a new instance of Partition.
26 27 28 29 30 31 |
# File 'lib/droonga/partition.rb', line 26 def initialize(={}) = @n_workers = [:n_workers] || 0 @processor = Processor.new() @supervisor = nil end |
Instance Method Details
#process(envelope, synchronous = nil) ⇒ Object
45 46 47 48 49 |
# File 'lib/droonga/partition.rb', line 45 def process(envelope, synchronous=nil) $log.trace("partition: process: start") @processor.process(envelope, synchronous) $log.trace("partition: process: done") end |
#shutdown ⇒ Object
38 39 40 41 42 43 |
# File 'lib/droonga/partition.rb', line 38 def shutdown $log.trace("partition: shutdown: start") shutdown_supervisor if @supervisor @processor.shutdown $log.trace("partition: shutdown: done") end |
#start ⇒ Object
33 34 35 36 |
# File 'lib/droonga/partition.rb', line 33 def start @processor.start start_supervisor if @n_workers > 0 end |