Suppose that I have a Django view and that I would like to call two APIs at the same time.
def djangoview(request):
#Call API 1
#Call API 2 before API Call 1 finishes
#Wait for both calls to finish
output = [Apicall1.response, Apicall2.response]
return(HttpResponse)
I've been trying to use multiprocessing library and pools without success. I'm using Apache2 and Wsgi, how can I make this work? Maybe making the call on a different thread?