Module: EQ
- Defined in:
- lib/eq.rb,
lib/eq/job.rb,
lib/eq/logging.rb,
lib/eq/version.rb
Defined Under Namespace
Modules: Logging, Queueing, Working
Classes: ConfigurationError, Job
Constant Summary
collapse
- DEFAULT_CONFIG =
{
queue: 'sequel',
sequel: 'sqlite:/',
job_timeout: 5 }.freeze
- VERSION =
'0.0.1'
Class Method Summary
collapse
Class Method Details
.boot ⇒ Object
this boots queuing and working optional: to use another queuing or working subsystem just do require ‘eq/working’ or require ‘eq/queueing’ instead of require ‘eq/all’
28
29
30
31
|
# File 'lib/eq.rb', line 28
def boot
boot_queueing if defined? EQ::Queueing
boot_working if defined? EQ::Working
end
|
.boot_queueing ⇒ Object
38
39
40
|
# File 'lib/eq.rb', line 38
def boot_queueing
EQ::Queueing.boot
end
|
.boot_working ⇒ Object
42
43
44
|
# File 'lib/eq.rb', line 42
def boot_working
EQ::Working.boot
end
|
.config {|@config| ... } ⇒ Object
19
20
21
22
23
|
# File 'lib/eq.rb', line 19
def config
@config ||= OpenStruct.new DEFAULT_CONFIG
yield @config if block_given?
@config
end
|
.logger ⇒ Object
62
63
64
|
# File 'lib/eq.rb', line 62
def logger
Celluloid.logger
end
|
.queueing? ⇒ Boolean
54
55
56
|
# File 'lib/eq.rb', line 54
def queueing?
queue.alive?
end
|
.working? ⇒ Boolean
58
59
60
|
# File 'lib/eq.rb', line 58
def working?
worker.alive?
end
|