mardi 31 mars 2015

Efficient Ruby and Node.js communication/IPC

I have a main Node.js API application that needs to generate a PDF file, the only mature PDF generator is Prawn PDF, which is written in Ruby.


I basically need to spawn a Ruby process from Node.js, pass it an arbitrary JSON payload, then listen for contents returned by the Ruby process, and then download it in the browser.




  1. What would be the most efficient method for Node.js to spawn/start a Ruby process?




  2. How should Node.js pass information efficiently to the Ruby process? currently I am using a JSON payload, however, Ruby have to parse this, and I don't believe this is the fastest in terms of performance. Is there something more efficient that I can use to pass information between the two processes?




Aucun commentaire:

Enregistrer un commentaire