Class: WindUp::Router::RoundRobin

Inherits:
Base
  • Object
show all
Defined in:
lib/wind_up/routers.rb

Overview

Basic router using a RoundRobin strategy

Instance Method Summary collapse

Methods inherited from Base

#<<, #add_subscriber, #broadcast, #initialize, #remove_subscriber, #send_message, #subscribers

Constructor Details

This class inherits a constructor from WindUp::Router::Base

Instance Method Details

#next_subscriberObject

Signal new work to all subscribers/waiters



91
92
93
94
# File 'lib/wind_up/routers.rb', line 91

def next_subscriber
  subscribers.rotate!
  subscribers.last
end