Class: QB::IPC::STDIO::Server::InService
- Defined in:
- lib/qb/ipc/stdio/server/in_service.rb
Overview
QB STDIO Service to proxy interactive user input from the main process to modules.
Instance Attribute Summary
Attributes inherited from Service
#env_var_name, #name, #path, #server, #socket, #thread
Instance Method Summary collapse
-
#initialize(name:, socket_dir:, src:) ⇒ InService
constructor
A new instance of InService.
- #work_in_thread ⇒ Object
Methods inherited from Service
Constructor Details
#initialize(name:, socket_dir:, src:) ⇒ InService
Returns a new instance of InService.
6 7 8 9 |
# File 'lib/qb/ipc/stdio/server/in_service.rb', line 6 def initialize name:, socket_dir:, src: super name: name, socket_dir: socket_dir @src = src end |
Instance Method Details
#work_in_thread ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/qb/ipc/stdio/server/in_service.rb', line 11 def work_in_thread while (line = @src.gets) do @socket.puts line end close! end |