Context
- I have an app that does time-consuming processing of texts in Ruby.
- When a users submits a text, a background process is forked to take care of that text.
- This process continuously outputs new parts of the text as they have been processed.
- Meanwhile, the user is redirected to the page where the processed text will be output.
My question is: how can the client's Javascript communicate with a process running on the server, given its PID? Is that possible? Do I need to wrap each background process inside its own servlet running on its own port?