Class: Horde
- Inherits:
-
Object
- Object
- Horde
- Includes:
- SemanticLogger::Loggable
- Defined in:
- lib/parallel_minion/horde.rb
Overview
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
Instance Attribute Summary collapse
-
#capacity ⇒ Object
readonly
Returns the maximum number of Minions active in this Horde at any time.
-
#description ⇒ Object
readonly
Returns the description for this Horde.
-
#max_queue_size ⇒ Object
readonly
Returns the maximum number of queued up requests before blocking new requests for work.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Horde
constructor
Create a new Horde of Minions.
Constructor Details
#initialize(params = {}) ⇒ Horde
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)
39 40 |
# File 'lib/parallel_minion/horde.rb', line 39 def initialize(params={}) end |
Instance Attribute Details
#capacity ⇒ Object (readonly)
Returns the maximum number of Minions active in this Horde at any time
17 18 19 |
# File 'lib/parallel_minion/horde.rb', line 17 def capacity @capacity end |
#description ⇒ Object (readonly)
Returns the description for this Horde
14 15 16 |
# File 'lib/parallel_minion/horde.rb', line 14 def description @description end |
#max_queue_size ⇒ Object (readonly)
Returns the maximum number of queued up requests before blocking new requests for work
21 22 23 |
# File 'lib/parallel_minion/horde.rb', line 21 def max_queue_size @max_queue_size end |