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/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: AsyncProxy, BasicObject, CLI, Configuration, Connection, Hooks, Job, Worker
Constant Summary collapse
- VERSION =
"1.5.0"
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) ⇒ 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
60 61 62 |
# File 'lib/backburner.rb', line 60 def configuration @_configuration ||= Configuration.new end |
.configure {|configuration| ... } ⇒ Object
Yields a configuration block
50 51 52 53 |
# File 'lib/backburner.rb', line 50 def configure(&block) yield(configuration) configuration end |
.default_queues ⇒ Object
Returns the queues that are processed by default if none are specified
70 71 72 |
# File 'lib/backburner.rb', line 70 def default_queues configuration.default_queues end |
.enqueue(job_class, *args) ⇒ Object
Enqueues a job to be performed with given arguments.
27 28 29 |
# File 'lib/backburner.rb', line 27 def enqueue(job_class, *args) Backburner::Worker.enqueue(job_class, args, {}) end |
.work(*tubes) ⇒ Object
Begins working on jobs enqueued with optional tubes specified
37 38 39 40 41 |
# File 'lib/backburner.rb', line 37 def work(*tubes) = tubes.last.is_a?(Hash) ? tubes.pop : {} worker_class = [:worker] || configuration.default_worker worker_class.start(tubes) end |