� end
up an aggregated event loop, and then run it with the “loop” method.
–
Posted viahttp://www.ruby-forum.com/.
Basically, I just want to manage 2 PCs.
“sending command to PC1
wait until command finished
sending command to PC2
wait until command finished
sending command to PC1
wait until command finished”
I thought open both sessions at the same time was a convenient way to
open them only once.
Hm…I’m not an expert, but it seems to me in this case that it’d be
easier actually just to code it that way.
If your commands are short, you could always inline them with a {} style
block instead of do/end, if you really want to cut down on your line
count.
I guess for establishing the sessions, maybe it’s a little inefficient
since you’re opening up four sessions instead of two, but sometimes you
just have to DTSTTCPW.
end
up an aggregated event loop, and then run it with the “loop” method.
–
Posted viahttp://www.ruby-forum.com/.
Basically, I just want to manage 2 PCs.
“sending command to PC1
wait until command finished
sending command to PC2
wait until command finished
sending command to PC1
wait until command finished”
I thought open both sessions at the same time was a convenient way to
open them only once.
"sending command to PC1
easier actually just to code it that way.
If your commands are short, you could always inline them with a {} style
block instead of do/end, if you really want to cut down on your line
count.
I guess for establishing the sessions, maybe it’s a little inefficient
since you’re opening up four sessions instead of two, but sometimes you
just have to DTSTTCPW.
Posted viahttp://www.ruby-forum.com/.
I may try this, but I want to avoid since this code is executed more
than 200 times.
lyrics wrote:
I would enclose all the commands in a specific script on the target
client.
And then just execute this top level script from your ssh session…your
native script will take care of the rest.
(obviously it does not work if your a building your program logic on the
fly …but you can also create your script on your box, scp to the target
box and then execute it)
–
I thought open both sessions at the same time was a convenient way to
since you’re opening up four sessions instead of two, but sometimes you
just have to DTSTTCPW.
–
Posted viahttp://www.ruby-forum.com/.
I may try this, but I want to avoid since this code is executed more
than 200 times.
I did more test.
I found out that I was working on the wrong issue:
the “exec!” command do it job well.
I think my issue comes from restarting a service.
It likes it takes times before really “up” whereas the command returns.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.