Module: Mqjob

Extended by:
Mqjob
Included in:
Mqjob
Defined in:
lib/mqjob.rb,
lib/mqjob/worker.rb,
lib/mqjob/version.rb,
lib/mqjob/thread_pool.rb,
lib/mqjob/worker_group.rb

Defined Under Namespace

Modules: Worker, WorkerGroup Classes: Config, Formatter, ThreadPool

Constant Summary collapse

VERSION =
"0.4.6"

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



13
14
15
# File 'lib/mqjob.rb', line 13

def config
  @config
end

Instance Method Details

#configure {|@config| ... } ⇒ Object

Yields:



15
16
17
18
19
# File 'lib/mqjob.rb', line 15

def configure(&block)
  @config ||= Config.new

  yield @config
end

#default_clientObject



25
26
27
# File 'lib/mqjob.rb', line 25

def default_client
  config&.client
end

#hooksObject



21
22
23
# File 'lib/mqjob.rb', line 21

def hooks
  config&.hooks
end

#loggerObject



40
41
42
43
44
# File 'lib/mqjob.rb', line 40

def logger
  config.logger ||= ::Logger.new(STDOUT).tap do |logger|
                      logger.formatter = Formatter.new
                    end
end

#regist_class(v) ⇒ Object



34
35
36
37
38
# File 'lib/mqjob.rb', line 34

def regist_class(v)
  @registed_class ||= []
  @registed_class << v
  @registed_class.uniq!
end

#registed_classObject

FIXME when job inherit from parent job it will not appear here!!



30
31
32
# File 'lib/mqjob.rb', line 30

def registed_class
  @registed_class ||= []
end