'Python: How to call rest endpoint and not wait for it to finish (fire and forget)?

I have a data collector python script that is started each minute by cron, gets some data and puts it into the database.

At its end, data collector should post last row id to a processing rest endpoint under my control and exit. Data collector script shouldn't wait for processing to finish, so whatever happens in data processor shouldn't influence data collector by any means. Data collector script don't need any response from rest endpoint.

Upon calling, processing endpoint will retrieve data from the database and do its work. Processing could eventually take more than a minute to finish, but more often in less than 30 seconds.

How to call rest endpoint and not wait for it to finish?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source