T
Thibaut Barrère
Hi,
I'm just wondering - I implemented something (http://github.com/thbar/
petite-lettre/tree/master) I believe probably already exists, can
anyone tell me if it does ?
I'm using YAML to communicate using stdin/stdout between a Ruby MRI
process and a JRuby process (I will soon use it to communicate between
IronRuby and JRuby).
The parent process launches the child using:
PetiteLettre.call("ruby child_program.rb", { :command
=> :start_sale, :isbn => "1234567", rice => 12.4 })
and the child responds with:
PetiteLettre.receive do |message|
response = {}
if message[:command] == :start_sale
# do something here
raise "Price is too low" if message[rice] < 15.0
response[:status] = "OK"
response[:transaction_id] = "1235"
else
raise "Unknown command '#{message[:command]}'"
end
response
end
If something already exists in Ruby to do that this way, I'd like to
know about it.
Any idea ?
Thibaut
I'm just wondering - I implemented something (http://github.com/thbar/
petite-lettre/tree/master) I believe probably already exists, can
anyone tell me if it does ?
I'm using YAML to communicate using stdin/stdout between a Ruby MRI
process and a JRuby process (I will soon use it to communicate between
IronRuby and JRuby).
The parent process launches the child using:
PetiteLettre.call("ruby child_program.rb", { :command
=> :start_sale, :isbn => "1234567", rice => 12.4 })
and the child responds with:
PetiteLettre.receive do |message|
response = {}
if message[:command] == :start_sale
# do something here
raise "Price is too low" if message[rice] < 15.0
response[:status] = "OK"
response[:transaction_id] = "1235"
else
raise "Unknown command '#{message[:command]}'"
end
response
end
If something already exists in Ruby to do that this way, I'd like to
know about it.
Any idea ?
Thibaut