Class: Taskinator::Queues::LoggedAdapter

Inherits:
Delegator
  • Object
show all
Defined in:
lib/taskinator/queues.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(adapter) ⇒ LoggedAdapter

Returns a new instance of LoggedAdapter.



22
23
24
25
# File 'lib/taskinator/queues.rb', line 22

def initialize(adapter)
  Taskinator.logger.info("Initialized '#{adapter.class.name}' queue adapter")
  @adapter = adapter
end

Instance Attribute Details

#adapterObject (readonly)

Returns the value of attribute adapter.



20
21
22
# File 'lib/taskinator/queues.rb', line 20

def adapter
  @adapter
end

Instance Method Details

#__getobj__Object



27
28
29
# File 'lib/taskinator/queues.rb', line 27

def __getobj__
  adapter
end

#enqueue_create_process(definition, uuid, args) ⇒ Object



31
32
33
34
# File 'lib/taskinator/queues.rb', line 31

def enqueue_create_process(definition, uuid, args)
  Taskinator.logger.info("Enqueuing process creation for #{definition}")
  adapter.enqueue_create_process(definition, uuid, args)
end

#enqueue_task(task) ⇒ Object



36
37
38
39
# File 'lib/taskinator/queues.rb', line 36

def enqueue_task(task)
  Taskinator.logger.info("Enqueuing task #{task}")
  adapter.enqueue_task(task)
end