Class: Aggkit::ChildProcess::JRuby::Pump

Inherits:
Object
  • Object
show all
Defined in:
lib/aggkit/childprocess/jruby/pump.rb

Constant Summary collapse

BUFFER_SIZE =
2048

Instance Method Summary collapse

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

#runObject



18
19
20
21
22
# File 'lib/aggkit/childprocess/jruby/pump.rb', line 18

def run
  @thread = Thread.new { pump }

  self
end

#stopObject



13
14
15
16
# File 'lib/aggkit/childprocess/jruby/pump.rb', line 13

def stop
  @stop = true
  @thread && @thread.join
end