https://gist.github.com/joefutrelle/20bc25f566b39ce10db46322a9483a48
https://gist.github.com/joefutrelle/3acd581e12627472a0c6688e46275df2
$ docker-compose build && docker-compose up
$ python client.py
- Client calls the endpoint simultaneously in different threads
- API creates a token and adds the task to the database with a "processing" status
- API publishes a message with the token and payload to a rabbitmq exchange
- The processor receves the message published by the API
- The processor sleeps for a few seconds to simulate a long running task and performs some operation on the payload, and publishes the token, the transformed data, and a "complete" status to the database
- While the processor is working, the API polls the database for status until it receives "complete", and returns the payload and token to the client