Method: Tap::Task#process
- Defined in:
- lib/tap/task.rb
#process(*inputs) ⇒ Object
The method for processing inputs into outputs. Override this method in subclasses to provide class-specific process logic. The arguments given to enq/exe should correspond to the arguments required by process. The process return is the result passed to joins.
class TaskWithTwoInputs < Tap::Task
def process(a, b)
[b,a]
end
end
results = []
app = Tap::App.new
task = TaskWithTwoInputs.new({}, app)
task.enq(1,2).enq(3,4)
task.on_complete {|result| results << result }
app.run
results # => [[2,1], [4,3]]
By default, process simply returns the inputs.
133 134 135 |
# File 'lib/tap/task.rb', line 133 def process(*inputs) inputs end |