Class: QB::IPC::STDIO::Client
- Inherits:
-
Object
- Object
- QB::IPC::STDIO::Client
- Includes:
- NRSER::Log::Mixin
- Defined in:
- lib/qb/ipc/stdio/client.rb
Defined Under Namespace
Classes: Connection
Instance Attribute Summary collapse
- #log ⇒ Connection readonly
- #stderr ⇒ Connection readonly
- #stdin ⇒ Connection readonly
- #stdout ⇒ Connection readonly
Instance Method Summary collapse
-
#connect! ⇒ self
Attempt to connect the three streams.
-
#connections ⇒ Array<Connection>
The three Connection instances.
- #disconnect! ⇒ Object
-
#initialize ⇒ Client
constructor
Instantiate a new
QB::IPC::STDIO::Client
.
Constructor Details
#initialize ⇒ Client
Instantiate a new QB::IPC::STDIO::Client
.
233 234 235 236 237 238 |
# File 'lib/qb/ipc/stdio/client.rb', line 233 def initialize @stdin = Connection.new name: :in, type: :in @stdout = Connection.new name: :out, type: :out @stderr = Connection.new name: :err, type: :out @log = Connection.new name: :log, type: :out end |
Instance Attribute Details
#log ⇒ Connection (readonly)
226 227 228 |
# File 'lib/qb/ipc/stdio/client.rb', line 226 def log @log end |
#stderr ⇒ Connection (readonly)
223 224 225 |
# File 'lib/qb/ipc/stdio/client.rb', line 223 def stderr @stderr end |
#stdin ⇒ Connection (readonly)
217 218 219 |
# File 'lib/qb/ipc/stdio/client.rb', line 217 def stdin @stdin end |
#stdout ⇒ Connection (readonly)
220 221 222 |
# File 'lib/qb/ipc/stdio/client.rb', line 220 def stdout @stdout end |
Instance Method Details
#connect! ⇒ self
Attempt to connect the three streams.
255 256 257 258 |
# File 'lib/qb/ipc/stdio/client.rb', line 255 def connect! connections.each &:connect! self end |
#connections ⇒ Array<Connection>
Returns The three Connection instances.
246 247 248 |
# File 'lib/qb/ipc/stdio/client.rb', line 246 def connections [ @stdin, @stdout, @stderr, @log ] end |
#disconnect! ⇒ Object
262 263 264 265 |
# File 'lib/qb/ipc/stdio/client.rb', line 262 def disconnect! connections.each &:disconnect! self end |