title: Make distinct applications communicate
body: <p>On OSX, I have a Rails web application(let's call it X) and a Natural Language Processing component written in Scala(let's call it Y).</p>
  
  <p>I want the following workflow:</p>
  
  <ol>
  <li>The user submits a document online to X.</li>
  <li>X passes the document to Y.</li>
  <li>Y does some processing and passes another document back to X.</li>
  <li>X displays the document to the user.</li>
  </ol>
  
  <p>X and Y are complete. However, right now their communication is very bad: they are both placing documents in a given folder(which I have hardcoded in both).</p>
  
  <p>What is a good and clean way of making them communicate?</p>