Class: BackgroundQueue::ServerLib::Owner

Inherits:
PriorityQueue show all
Includes:
QueueRegistry
Defined in:
lib/background_queue/server_lib/owner.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from QueueRegistry

#add_item, #finish_item, #next_item, #remove_item

Methods inherited from PriorityQueue

#each_item, #empty?, #has_running_items?, #number_if_items_at_priority, #number_of_priorities, #peek, #pop, #priority, #push, #remove, #stalled=, #stalled?

Constructor Details

#initialize(id, balanced_queues) ⇒ Owner

Returns a new instance of Owner.



8
9
10
11
12
# File 'lib/background_queue/server_lib/owner.rb', line 8

def initialize(id, balanced_queues)
  @id = id
  @balanced_queues = balanced_queues
  super()
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



6
7
8
# File 'lib/background_queue/server_lib/owner.rb', line 6

def id
  @id
end

Class Method Details

.queue_classObject



27
28
29
# File 'lib/background_queue/server_lib/owner.rb', line 27

def self.queue_class
  BackgroundQueue::ServerLib::Job
end

Instance Method Details

#==(other) ⇒ Object



15
16
17
# File 'lib/background_queue/server_lib/owner.rb', line 15

def ==(other)
  @id == other.id
end

#inspectObject



23
24
25
# File 'lib/background_queue/server_lib/owner.rb', line 23

def inspect
  "OwnerQueue:#{self.id} (#{self.object_id})"
end

#serverObject



19
20
21
# File 'lib/background_queue/server_lib/owner.rb', line 19

def server
  @balanced_queues.server
end

#synchronous?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/background_queue/server_lib/owner.rb', line 31

def synchronous?
  false
end