Say I have the following pandas df:
col_1 | col_2 | server_one_response | server_two_response
5 2
2 3
2 8
9 8
10 9
How could I apply the 2 functions from below on my df
on 2 different threads
(not processes
) to return data from 2 different servers:
def get_server_one_result(a, b):
'get some interestig data from the server'
return response
def get_server_two_result(a, b):
'get some interestig data from another server'
return response
The point is that while the first function is busy waiting for a server response and calculation, the other function will retrieve data from another server.