Module: Backburner
- Defined in:
- lib/backburner.rb,
lib/backburner/cli.rb,
lib/backburner/job.rb,
lib/backburner/hooks.rb,
lib/backburner/queue.rb,
lib/backburner/logger.rb,
lib/backburner/worker.rb,
lib/backburner/helpers.rb,
lib/backburner/version.rb,
lib/backburner/connection.rb,
lib/backburner/async_proxy.rb,
lib/backburner/performable.rb,
lib/backburner/allq_wrapper.rb,
lib/backburner/configuration.rb,
lib/backburner/workers/simple.rb,
lib/backburner/workers/forking.rb,
lib/backburner/workers/threading.rb,
lib/backburner/workers/threads_on_fork.rb
Defined Under Namespace
Modules: Helpers, Logger, Performable, Queue, Workers Classes: AllQJob, AllQWrapper, AllqWatcher, AsyncProxy, BasicObject, CLI, Configuration, Connection, Hooks, Job, Worker
Constant Summary collapse
- VERSION =
"1.0.44"
Class Method Summary collapse
-
.configuration ⇒ Object
Returns the configuration options set for Backburner.
-
.configure {|configuration| ... } ⇒ Object
Yields a configuration block.
-
.default_queues ⇒ Object
Returns the queues that are processed by default if none are specified.
-
.enqueue(job_class, args, opts = {}) ⇒ Object
Enqueues a job to be performed with given arguments.
-
.work(*tubes) ⇒ Object
Begins working on jobs enqueued with optional tubes specified.
Class Method Details
.configuration ⇒ Object
Returns the configuration options set for Backburner
62 63 64 |
# File 'lib/backburner.rb', line 62 def configuration @_configuration ||= Configuration.new end |
.configure {|configuration| ... } ⇒ Object
Yields a configuration block
52 53 54 55 |
# File 'lib/backburner.rb', line 52 def configure(&block) yield(configuration) configuration end |
.default_queues ⇒ Object
Returns the queues that are processed by default if none are specified
72 73 74 |
# File 'lib/backburner.rb', line 72 def default_queues configuration.default_queues end |
.enqueue(job_class, args, opts = {}) ⇒ Object
Enqueues a job to be performed with given arguments.
27 28 29 30 |
# File 'lib/backburner.rb', line 27 def enqueue(job_class, args, opts={}) opts[:shard_key] = opts[:shard_key].nil? ? "X" : opts[:shard_key].to_s Backburner::Worker.enqueue(job_class, args, opts) end |
.work(*tubes) ⇒ Object
Begins working on jobs enqueued with optional tubes specified
39 40 41 42 43 |
# File 'lib/backburner.rb', line 39 def work(*tubes) = tubes.last.is_a?(Hash) ? tubes.pop : {} worker_class = [:worker] || configuration.default_worker worker_class.start(tubes) end |