I'm trying to figure out how to best approach the below problem. Essentially I have an external API Service that I am sending requests to and getting results for.
POST = Send request and the response you get back is a URL which you can use for the GET requests to retrieve your results.
GET = Poll the returned URL from the POST request until you get a successful result.
What would be the best way to approach this in airflow? My idea is to essentially have 2 tasks running in parallel.
- One sending the POST requests and then saving the response URL to XCOM.
- The other would be continuously running in a while loop, reading from the XCOM store for new URL responses and getting responses. It would then delete from XCOM store once it has a retrieved a succesfuly result from that URL.
Do you think this is the correct way of going about it? Or possibly should i use the asyncio library in python?
Any help much appreciated
Thanks,