Consider the following Python function:
def make_request(arg1, arg2):
make http request
I want to be able to create 5 threads that all call the make_request()
function, however, I want it to be the case that as soon as one thread finishes another identical thread (making the same call to the make_request()
function) starts. It seems that python does not actually support the 'restarting' of threads, so I thought to make it so that the make_request()
never terminates by means of a while True:
loop like so:
def make_request(arg1, arg2):
while True:
make http request
However, this does not seem like best practice and I am not sure if this approach may have unintended consequences.