Python:如何调用休息端点而不等待它完成(即发即忘)?
我有一个数据收集器 python 脚本,它由 cron 每分钟启动一次,获取一些数据并将其放入数据库中。
最后,数据收集器应将最后一行 id 发布到我控制下的处理休息端点并退出。 数据收集器脚本不应等待处理完成,因此数据处理器中发生的任何情况都不应以任何方式影响数据收集器。 数据收集器脚本不需要来自休息端点的任何响应。
调用后,处理端点将从数据库检索数据并完成其工作。 处理最终可能需要一分多钟才能完成,但更常见的是不到 30 秒。
如何调用休息端点而不等待它完成?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论