I have the following workflow I am looking for a Rails app:
- Parse incoming request
- Construct 3rd party web service request
- Send 3rd party request
- Enqueue a worker to process the expected response
-
Process the response once it arrives Send the parsed result back as a response
-
What are the models needed besides the data objects I am working with? (e.g. queues, workers, etc?)
- Which of the standard Rails controllers do I need to re implement to accomplish this?
All results are passed via JSON.
That step #4 – Enqueue a worker to process the expected response is the difficult one. Why not just queue up the job when you get the response?
To process the response outside the web app, my recommendation would be to queue up the worker to process the job, after you receive the response. This seems like the best route.
The only other way I can think of doing this, is creating another application to process the responses, and sending the 3rd party response to that application, and then sending the computed results back to your webapp.