Class: Rubcask::Server::Runner::Config
- Inherits:
-
Struct
- Object
- Struct
- Rubcask::Server::Runner::Config
- Defined in:
- lib/rubcask/server/runner/config.rb
Overview
Server runner config
Instance Attribute Summary collapse
-
#directory_path ⇒ String
Path of the directory in which the data is stored.
-
#merge_interval ⇒ Integer, null
How frequent in seconds should merge operation by run.
-
#server_type ⇒ :threaded, :async
Which type of server should be run.
Class Method Summary collapse
-
.configure(&block) ⇒ Object
Calls new and freezes the config.
Instance Method Summary collapse
-
#initialize {|config| ... } ⇒ Config
constructor
Overide fields with the block.
Constructor Details
#initialize {|config| ... } ⇒ Config
Overide fields with the block
27 28 29 30 31 32 33 |
# File 'lib/rubcask/server/runner/config.rb', line 27 def initialize self.server_type = :threaded self.merge_interval = 3_600 self.directory_path = nil yield(self) if block_given? end |
Instance Attribute Details
#directory_path ⇒ String
Path of the directory in which the data is stored.
Default: no default value, user has to set it manually.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/rubcask/server/runner/config.rb', line 24 Config = Struct.new(:merge_interval, :server_type, :directory_path) do # Overide fields with the block # @yieldparam [self] config def initialize self.server_type = :threaded self.merge_interval = 3_600 self.directory_path = nil yield(self) if block_given? end # Calls new and freezes the config # @see .initialize def self.configure(&block) new(&block).freeze end end |
#merge_interval ⇒ Integer, null
How frequent in seconds should merge operation by run.
Default: 3600
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/rubcask/server/runner/config.rb', line 24 Config = Struct.new(:merge_interval, :server_type, :directory_path) do # Overide fields with the block # @yieldparam [self] config def initialize self.server_type = :threaded self.merge_interval = 3_600 self.directory_path = nil yield(self) if block_given? end # Calls new and freezes the config # @see .initialize def self.configure(&block) new(&block).freeze end end |
#server_type ⇒ :threaded, :async
Which type of server should be run.
Use threaded if you are not on MRI. If you are on mri and can install ‘async-io` use :async.
Default: :threaded
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/rubcask/server/runner/config.rb', line 24 Config = Struct.new(:merge_interval, :server_type, :directory_path) do # Overide fields with the block # @yieldparam [self] config def initialize self.server_type = :threaded self.merge_interval = 3_600 self.directory_path = nil yield(self) if block_given? end # Calls new and freezes the config # @see .initialize def self.configure(&block) new(&block).freeze end end |
Class Method Details
.configure(&block) ⇒ Object
Calls new and freezes the config
37 38 39 |
# File 'lib/rubcask/server/runner/config.rb', line 37 def self.configure(&block) new(&block).freeze end |