Class: Wye::Distributor::RoundRobin

Inherits:
Object
  • Object
show all
Defined in:
lib/wye/distributor/round_robin.rb

Instance Method Summary collapse

Constructor Details

#initialize(values) ⇒ RoundRobin

Returns a new instance of RoundRobin.



4
5
6
# File 'lib/wye/distributor/round_robin.rb', line 4

def initialize(values)
  @cycle = values.cycle
end

Instance Method Details

#next(*arguments) ⇒ Object



8
9
10
11
12
# File 'lib/wye/distributor/round_robin.rb', line 8

def next(*arguments)
  @cycle.next
rescue StopIteration
  nil
end