我的開發堆棧是Django/Python
。 (包括Django-REST框架) 我目前正在尋找方法來做多個不同的API調用。在Python/Django中將多個POST請求作爲多線程提交
client.py
def submit_order(list_of_orders):
//submit each element in list_of_orders in thread
for order in list_of_orders:
try:
response=request.POST(order, "www.confidential.url.com")
except:
//retry_again
else:
if !response.status==200:
//retry_again
在上面的方法中,我目前正在逐一提交訂單,我想一次提交所有訂單。其次,如果失敗,我想重新提交x次。 我目前不知道如何實現它。
我正在尋找Python庫或Django應用程序提供的方式,而不是重新發明方向盤。
感謝
你可以看看[django-celery](http://celery.readthedocs.org/en/latest/) – Selcuk 2015-02-11 00:10:07