For perhaps a year or two, whenever consider updating some single-threaded scripts I use that use Net::SSH to talk to some devices, I do a search for various async Ruby ways to modify things and parallelize the aforementioned scripts. In the past I've resorted to simply forking a bunch of processes, but I'd like to avoid that if possible. Every search, however, returns the same 2015 results where some folks mention that Celluloid::IO is compatible with Net::SSH, but those results do not include any useful examples, and are full of caveats and warnings about some proxy parameter (never actually demonstrated in use) not being supported.
So, in 2018, what is the state of Net::SSH compatibility with Celluloid?
Say I was trying something a little like:
class Foo
include Celluloid
...
def do_connect
@ssh = Net::SSH.start(...)
end
def do_some_command(cmd)
@blah << @ssh.exec!(cmd)
end
...
end
... code that creates several instances of Foo with various SSH IP/user/host configurations ...
...
foo_instance_5.async.do_connect
foo_instance_6.async.do_connect
...
foo_instance_1.async.do_command(...)
foo_instance_9.async.do_command(...)
...
And so on. Anyone up for providing some examples how I can encourage SSH to NOT BLOCK using Celluloid? Or is it a no-win situation where Net::SSH just isn't going to cooperate, even in 2018?
Thanks for any/all pointers!
Aaron out.