Class: Woodhouse::Dispatchers::FileDispatcher
- Inherits:
-
Woodhouse::Dispatcher
- Object
- Woodhouse::Dispatcher
- Woodhouse::Dispatchers::FileDispatcher
- Defined in:
- lib/woodhouse/dispatchers/file_dispatcher.rb
Constant Summary collapse
- DEFAULT_QUEUE_DIR =
'/tmp/woodhouse/queue'
Instance Attribute Summary collapse
-
#jobs_dir ⇒ Object
Returns the value of attribute jobs_dir.
-
#queue_dir ⇒ Object
Returns the value of attribute queue_dir.
Instance Method Summary collapse
-
#initialize(config, opts = {}, &blk) ⇒ FileDispatcher
constructor
A new instance of FileDispatcher.
Methods inherited from Woodhouse::Dispatcher
#dispatch, #dispatch_job, #update_job
Constructor Details
#initialize(config, opts = {}, &blk) ⇒ FileDispatcher
Returns a new instance of FileDispatcher.
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/woodhouse/dispatchers/file_dispatcher.rb', line 8 def initialize(config, opts = {}, &blk) super server_info = @config.server_info || {} self.queue_dir = server_info[:path] || DEFAULT_QUEUE_DIR self.jobs_dir = "#{queue_dir}/jobs" unless File.directory?(jobs_dir) # subdirectory of queue_dir @config.logger.debug "[Woodhouse initialize] Creating queue directory '#{queue_dir}'" FileUtils.mkdir_p jobs_dir end end |
Instance Attribute Details
#jobs_dir ⇒ Object
Returns the value of attribute jobs_dir.
4 5 6 |
# File 'lib/woodhouse/dispatchers/file_dispatcher.rb', line 4 def jobs_dir @jobs_dir end |
#queue_dir ⇒ Object
Returns the value of attribute queue_dir.
4 5 6 |
# File 'lib/woodhouse/dispatchers/file_dispatcher.rb', line 4 def queue_dir @queue_dir end |