class Riffer::Runner
Generic concurrency primitive for batch execution.
Subclasses implement map to control how items are processed (sequentially, threaded, etc.).
runner = Riffer::Runner::Sequential.new runner.map([1, 2, 3], context: ctx) { |n| n * 2 } # => [2, 4, 6]
Public Instance Methods
Source
# File lib/riffer/runner.rb, line 23 def map(items, context:, &block) raise NotImplementedError, "#{self.class} must implement #map" end
Maps over items using the provided block.
- items
-
the items to process.
- context
-
context hash forwarded from the agent.
Raises NotImplementedError if not implemented by subclass.