Class: Net::SSH::Connection::Session
- Inherits:
-
Object
- Object
- Net::SSH::Connection::Session
- Includes:
- Open3
- Defined in:
- lib/net-ssh-open3.rb
Instance Method Summary collapse
- #close(*args, &block) ⇒ Object
-
#initialize(*args, &block) ⇒ Session
constructor
Overridden version of
initializewhich starts an Open3 SSH loop.
Methods included from Open3
#capture2, #capture2e, #capture3, #popen2, #popen2e, #popen3
Constructor Details
#initialize(*args, &block) ⇒ Session
Overridden version of initialize which starts an Open3 SSH loop.
438 439 440 441 442 443 444 445 446 447 448 449 |
# File 'lib/net-ssh-open3.rb', line 438 def initialize(*args, &block) initialize_without_open3(*args, &block) @open3_channels_mutex = Mutex.new # open3_ping method will pull waiter thread out of select(2) call # to update watched Channels and IOs and process incomes. @open3_pinger_reader, @open3_pinger_writer = IO.pipe listen_to(@open3_pinger_reader) { @open3_pinger_reader.readpartial(1) } @session_loop = Thread.new { open3_loop } end |
Instance Method Details
#close(*args, &block) ⇒ Object
452 453 454 455 |
# File 'lib/net-ssh-open3.rb', line 452 def close(*args, &block) @open3_closing = true close_without_open3(*args, &block).tap { open3_ping rescue nil } end |