class DRbQueue::Configuration
Attributes
error_handler[RW]
immediate[RW]
logger[RW]
num_workers[RW]
persistence_store[RW]
socket_location[RW]
Public Class Methods
new()
click to toggle source
# File lib/drb_queue/configuration.rb, line 5 def initialize self.socket_location = '/tmp/drb_queue' self.num_workers = 1 self.logger = Logger.new(STDOUT) self.error_handler = lambda { |e| logger.error(([e.message] + e.backtrace).join("\n")) } end
Public Instance Methods
after_fork(&block)
click to toggle source
# File lib/drb_queue/configuration.rb, line 32 def after_fork(&block) after_fork_callbacks << block end
after_fork_callbacks()
click to toggle source
# File lib/drb_queue/configuration.rb, line 40 def after_fork_callbacks @after_fork_callbacks ||= [] end
before_fork(&block)
click to toggle source
# File lib/drb_queue/configuration.rb, line 36 def before_fork(&block) before_fork_callbacks << block end
before_fork_callbacks()
click to toggle source
# File lib/drb_queue/configuration.rb, line 44 def before_fork_callbacks @before_fork_callbacks ||= [] end
construct_persistence_store()
click to toggle source
# File lib/drb_queue/configuration.rb, line 18 def construct_persistence_store return unless persistence_store persistence_store[0].new(persistence_store[1]) end
immediate!()
click to toggle source
# File lib/drb_queue/configuration.rb, line 24 def immediate! self.immediate = true end
on_error(&block)
click to toggle source
# File lib/drb_queue/configuration.rb, line 28 def on_error(&block) self.error_handler = block end
server_uri()
click to toggle source
# File lib/drb_queue/configuration.rb, line 48 def server_uri "drbunix:#{socket_location}" end
store(klass, options = {})
click to toggle source
# File lib/drb_queue/configuration.rb, line 12 def store(klass, options = {}) raise "Whoops, that's not a #{DRbQueue::Store}" unless klass <= DRbQueue::Store self.persistence_store = [klass, options] end