Module: Procrastinator
- Defined in:
- lib/procrastinator.rb,
lib/procrastinator/version.rb,
lib/procrastinator/environment.rb,
lib/procrastinator/task_worker.rb,
lib/procrastinator/queue_worker.rb
Defined Under Namespace
Classes: Environment, MalformedPersisterError, MalformedTaskError, MalformedTaskPersisterError, QueueWorker, TaskExpiredError, TaskWorker
Constant Summary
collapse
- VERSION =
'0.5.0'
- @@test_mode =
false
Class Method Summary
collapse
Class Method Details
.setup(persister) {|env| ... } ⇒ Object
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/procrastinator.rb', line 11
def self.setup(persister, &block)
raise ArgumentError.new('Procrastinator.setup must be given a block') if block.nil?
env = Environment.new(persister: persister, test_mode: @@test_mode)
yield(env)
raise RuntimeError.new('setup block did not define any queues') if env.queue_definitions.empty?
env.spawn_workers
env
end
|
.test_mode ⇒ Object
29
30
31
|
# File 'lib/procrastinator.rb', line 29
def self.test_mode
@@test_mode
end
|
.test_mode=(value) ⇒ Object
25
26
27
|
# File 'lib/procrastinator.rb', line 25
def self.test_mode=(value)
@@test_mode = value
end
|