Class: Pwrake::LifoQueueArray

Inherits:
Array
  • Object
show all
Defined in:
lib/pwrake/queue/queue_array.rb

Instance Method Summary collapse

Constructor Details

#initialize(n_cores = nil) ⇒ LifoQueueArray

Returns a new instance of LifoQueueArray.



64
65
66
# File 'lib/pwrake/queue/queue_array.rb', line 64

def initialize(n_cores=nil)
  super()
end

Instance Method Details

#shift(host_info) ⇒ Object



68
69
70
71
72
73
74
75
# File 'lib/pwrake/queue/queue_array.rb', line 68

def shift(host_info)
  (size-1).downto(0) do |i|
    if at(i).acceptable_for(host_info)
      return delete_at(i)
    end
  end
  nil
end