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.50"
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
64 65 66 |
# File 'lib/backburner.rb', line 64 def configuration @_configuration ||= Configuration.new end |
.configure {|configuration| ... } ⇒ Object
Yields a configuration block
54 55 56 57 |
# File 'lib/backburner.rb', line 54 def configure(&block) yield(configuration) configuration end |
.default_queues ⇒ Object
Returns the queues that are processed by default if none are specified
74 75 76 |
# File 'lib/backburner.rb', line 74 def default_queues configuration.default_queues end |
.enqueue(job_class, args, opts = {}) ⇒ Object
Enqueues a job to be performed with given arguments.
29 30 31 32 |
# File 'lib/backburner.rb', line 29 def enqueue(job_class, args, opts={}) opts[:shard_key] = "X" if opts[:shard_key].nil? Backburner::Worker.enqueue(job_class, args, opts) end |
.work(*tubes) ⇒ Object
Begins working on jobs enqueued with optional tubes specified
41 42 43 44 45 |
# File 'lib/backburner.rb', line 41 def work(*tubes) = tubes.last.is_a?(Hash) ? tubes.pop : {} worker_class = [:worker] || configuration.default_worker worker_class.start(tubes) end |