Class: Qyu::Queue::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/qyu/queue/base.rb

Overview

Qyu::Queue::Base

Direct Known Subclasses

Memory::Adapter

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.valid_config?(_config) ⇒ Boolean

This class acts as an interface for any queue adapter implemented for Qyu Implement the following methods in any queue and it should work seemlessly


9
10
11
# File 'lib/qyu/queue/base.rb', line 9

def self.valid_config?(_config)
  fail Qyu::Errors::NotImplementedError
end

Instance Method Details

#acknowledge_message(_queue_name, _message_id) ⇒ Object


33
34
35
# File 'lib/qyu/queue/base.rb', line 33

def acknowledge_message(_queue_name, _message_id)
  fail Qyu::Errors::NotImplementedError
end

#enqueue_task(_queue_name, _task_id) ⇒ Object

Instance methods to override


21
22
23
# File 'lib/qyu/queue/base.rb', line 21

def enqueue_task(_queue_name, _task_id)
  fail Qyu::Errors::NotImplementedError
end

#enqueue_task_to_failed_queue(_queue_name, _task_id) ⇒ Object


25
26
27
# File 'lib/qyu/queue/base.rb', line 25

def enqueue_task_to_failed_queue(_queue_name, _task_id)
  fail Qyu::Errors::NotImplementedError
end

#enqueue_tasks(queue_name, task_ids) ⇒ Object

Instance methods


14
15
16
17
18
# File 'lib/qyu/queue/base.rb', line 14

def enqueue_tasks(queue_name, task_ids)
  task_ids.each do |task_id|
    enqueue_task(queue_name, task_id)
  end
end

#fetch_next_message(_queue_name) ⇒ Object


29
30
31
# File 'lib/qyu/queue/base.rb', line 29

def fetch_next_message(_queue_name)
  fail Qyu::Errors::NotImplementedError
end

#queuesObject


37
38
39
# File 'lib/qyu/queue/base.rb', line 37

def queues
  fail Qyu::Errors::NotImplementedError
end

#size(_queue_name) ⇒ Object


41
42
43
# File 'lib/qyu/queue/base.rb', line 41

def size(_queue_name)
  fail Qyu::Errors::NotImplementedError
end