Class: Aggkit::ChildProcess::JRuby::Pump
- Inherits:
-
Object
- Object
- Aggkit::ChildProcess::JRuby::Pump
- Defined in:
- lib/aggkit/childprocess/jruby/pump.rb
Constant Summary collapse
- BUFFER_SIZE =
2048
Instance Method Summary collapse
-
#initialize(input, output) ⇒ Pump
constructor
A new instance of Pump.
- #run ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(input, output) ⇒ Pump
Returns a new instance of Pump.
7 8 9 10 11 |
# File 'lib/aggkit/childprocess/jruby/pump.rb', line 7 def initialize(input, output) @input = input @output = output @stop = false end |
Instance Method Details
#run ⇒ Object
18 19 20 21 22 |
# File 'lib/aggkit/childprocess/jruby/pump.rb', line 18 def run @thread = Thread.new { pump } self end |
#stop ⇒ Object
13 14 15 16 |
# File 'lib/aggkit/childprocess/jruby/pump.rb', line 13 def stop @stop = true @thread && @thread.join end |