Class: QB::Util::STDIO::OutService

Inherits:
Service
  • Object
show all
Defined in:
lib/qb/util/stdio.rb

Overview

QB STDIO Service to proxy output from modules back to the main user process.

Instance Method Summary collapse

Methods inherited from Service

#close!, #debug, #open!

Constructor Details

#initialize(name, dest) ⇒ OutService

Returns a new instance of OutService.



155
156
157
158
# File 'lib/qb/util/stdio.rb', line 155

def initialize name, dest
  super name
  @dest = dest
end

Instance Method Details

#work_in_threadObject



160
161
162
163
164
165
166
167
168
# File 'lib/qb/util/stdio.rb', line 160

def work_in_thread
  while (line = @socket.gets) do
    logger.trace "received line",
      line: line,
      dest: @dest
    
    @dest.puts line
  end
end