Reputation: 96897
I tried to make a script that would execute several external binaries to perform some tasks. Each binary was executed from a different thread, but the thing is, it didn't work ( because of the implementation of Ruby's threads in 1.8.6 ).
Is there a different way I could do this, or do I have to go with Ruby 1.9 ?
Upvotes: 1
Views: 240
Reputation: 24256
Have you try Ruby Daemons? I have about 15 external application running simultaneously with RoR by implement it. (http://daemons.rubyforge.org/)
Basically, you extract your thread code to another ruby file. say my_external_call.rb. then, create a daemon control
require 'daemons'
Daemons.run('my_external_call.rb')
execute it by 'ruby control.rb start | stop | status'
Upvotes: 2