Last active
December 21, 2015 12:58
-
-
Save hinrik/6308937 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'celluloid/io' | |
require 'celluloid/autostart' | |
require 'net/sftp' | |
class Foo | |
include Celluloid::IO | |
def initialize | |
async.connect_and_stat | |
end | |
def connect_and_stat | |
# without celluloid-io | |
#@sftp = Net::SFTP.start('localhost', ENV['USER']) | |
# with celluloid-io | |
@sftp = Net::SFTP.start('localhost', ENV['USER'], proxy: TCPSocket) | |
stat = @sftp.stat!('/etc/passwd') | |
p stat | |
terminate | |
end | |
end | |
Foo.run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment