Class: Shifty::Policy::Supply
- Inherits:
-
Object
- Object
- Shifty::Policy::Supply
- Defined in:
- lib/shifty/policy.rb
Overview
Wraps a worker's supply so that values the task pulls directly (e.g. filter/batch/trailing workers calling supply.shift mid-task) cross the boundary under the same policy as the primary intake.
Instance Method Summary collapse
-
#initialize(supply, worker) ⇒ Supply
constructor
A new instance of Supply.
- #shift ⇒ Object
Constructor Details
#initialize(supply, worker) ⇒ Supply
Returns a new instance of Supply.
114 115 116 117 |
# File 'lib/shifty/policy.rb', line 114 def initialize(supply, worker) @supply = supply @worker = worker end |
Instance Method Details
#shift ⇒ Object
119 120 121 |
# File 'lib/shifty/policy.rb', line 119 def shift @worker.intake(@supply.shift) end |