Class: Isono::Util::EmSystemCb

Inherits:
EventMachine::Connection
  • Object
show all
Defined in:
lib/isono/util.rb

Instance Method Summary collapse

Constructor Details

#initialize(io, in_buf, exit_cb) ⇒ EmSystemCb

Returns a new instance of EmSystemCb.



121
122
123
124
125
# File 'lib/isono/util.rb', line 121

def initialize(io, in_buf, exit_cb)
  @io = io
  @in_buf = in_buf
  @exit_cb = exit_cb
end

Instance Method Details

#post_initObject



127
128
129
130
131
132
# File 'lib/isono/util.rb', line 127

def post_init
  # send data to stdin for child process
  if @in_buf
    send_data @in_buf
  end
end

#receive_data(data) ⇒ Object



134
135
136
# File 'lib/isono/util.rb', line 134

def receive_data data
  @io.write(data)
end

#unbindObject



138
139
140
# File 'lib/isono/util.rb', line 138

def unbind()
  @exit_cb.call(get_status)
end