require 'minion' # A Horde is way to manage a group of Minions # # Horde supports the following features for minions # - Limit the number of Minions in the Horde to prevent overloading the system # - Queue up requests for Minions when the lmit is reached # - Optionally block submitting work for Minions when the queued up requests # reach a specified number class Horde include SemanticLogger::Loggable # Returns the description for this Horde attr_reader :description # Returns the maximum number of Minions active in this Horde at any time attr_reader :capacity # Returns the maximum number of queued up requests before blocking # new requests for work attr_reader :max_queue_size # Create a new Horde of Minions # # Parameters # :description # Description for this task that the Minion is performing # Put in the log file along with the time take to complete the task # # :capacity # Maximum number of Minions active in this Horde at any time # Default: 10 # # :max_queue_size # Maximum number of queued up requests before blocking # new requests for work # Default: -1 (unlimited) # def initialize(params={}) end end