Class: Datapipes::Source
- Inherits:
-
Object
- Object
- Datapipes::Source
- Includes:
- Composable
- Defined in:
- lib/datapipes/source.rb
Overview
Build your own source logic in ‘run` method. Use `produce` method to emitt data to pipe.
def run
10.times {|i| produce(i) }
end
Instance Attribute Summary collapse
-
#pipe ⇒ Object
Returns the value of attribute pipe.
Attributes included from Composable
Instance Method Summary collapse
Methods included from Composable
Instance Attribute Details
#pipe ⇒ Object
Returns the value of attribute pipe.
13 14 15 |
# File 'lib/datapipes/source.rb', line 13 def pipe @pipe end |
Instance Method Details
#run_all ⇒ Object
15 16 17 18 |
# File 'lib/datapipes/source.rb', line 15 def run_all @accumulated ||= [self] @accumulated.map {|s| Thread.new { s.run } } end |