Class: ChildProcess::JRuby::Pump
- Inherits:
-
Object
- Object
- ChildProcess::JRuby::Pump
- Defined in:
- lib/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.
6 7 8 9 10 |
# File 'lib/childprocess/jruby/pump.rb', line 6 def initialize(input, output) @input = input @output = output @stop = false end |
Instance Method Details
#run ⇒ Object
17 18 19 20 21 |
# File 'lib/childprocess/jruby/pump.rb', line 17 def run @thread = Thread.new { pump } self end |
#stop ⇒ Object
12 13 14 15 |
# File 'lib/childprocess/jruby/pump.rb', line 12 def stop @stop = true @thread && @thread.join end |