lib/backburner/configuration.rb in backburner-1.3.1 vs lib/backburner/configuration.rb in backburner-1.4.0
- old
+ new
@@ -15,10 +15,12 @@
attr_accessor :logger # logger
attr_accessor :default_worker # default worker class
attr_accessor :primary_queue # the general queue
attr_accessor :priority_labels # priority labels
attr_accessor :reserve_timeout # duration to wait to reserve on a single server
+ attr_accessor :job_serializer_proc # proc to write the job body to a string
+ attr_accessor :job_parser_proc # proc to parse a job body from a string
def initialize
@beanstalk_url = "beanstalk://127.0.0.1"
@tube_namespace = "backburner.worker.queue"
@namespace_separator = "."
@@ -32,9 +34,11 @@
@logger = nil
@default_worker = Backburner::Workers::Simple
@primary_queue = "backburner-jobs"
@priority_labels = PRIORITY_LABELS
@reserve_timeout = nil
+ @job_serializer_proc = lambda { |body| body.to_json }
+ @job_parser_proc = lambda { |body| JSON.parse(body) }
end
def namespace_separator=(val)
raise 'Namespace separator cannot used reserved queue configuration separator ":"' if val == ':'
@namespace_separator = val