Class: Proclib::OutputHandler
- Inherits:
-
Object
- Object
- Proclib::OutputHandler
- Defined in:
- lib/proclib/output_handler.rb
Overview
Emits events for the given io pipe with relevant tagging info
Defined Under Namespace
Classes: LineBuffer
Constant Summary collapse
- READ_SIZE =
1024- Message =
Class.new(Struct.new(:process_tag, :pipe_name, :line))
Instance Attribute Summary collapse
-
#channel ⇒ Object
readonly
Returns the value of attribute channel.
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type, command, channel:) ⇒ OutputHandler
constructor
A new instance of OutputHandler.
- #kill ⇒ Object
- #start ⇒ Object
- #wait ⇒ Object
Constructor Details
#initialize(type, command, channel:) ⇒ OutputHandler
50 51 52 |
# File 'lib/proclib/output_handler.rb', line 50 def initialize(type, command, channel:) @type, @command, @channel = type, command, channel end |
Instance Attribute Details
#channel ⇒ Object (readonly)
Returns the value of attribute channel.
49 50 51 |
# File 'lib/proclib/output_handler.rb', line 49 def channel @channel end |
#command ⇒ Object (readonly)
Returns the value of attribute command.
49 50 51 |
# File 'lib/proclib/output_handler.rb', line 49 def command @command end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
49 50 51 |
# File 'lib/proclib/output_handler.rb', line 49 def type @type end |
Instance Method Details
#kill ⇒ Object
62 63 64 |
# File 'lib/proclib/output_handler.rb', line 62 def kill @thread.exit end |
#start ⇒ Object
54 55 56 |
# File 'lib/proclib/output_handler.rb', line 54 def start @thread = Thread.new { monitor } end |
#wait ⇒ Object
58 59 60 |
# File 'lib/proclib/output_handler.rb', line 58 def wait @thread.join end |