Some years ago, (for comparison) synchronous JavaScript ajax requests were deprecated because of the overhead.
I’m in the following situation :
def ssh_network_operation_with_paramiko(string):
server_response=Do_some_stuff_with_null_characters_in_string(string)
Do_something_with_server_response(server_response)
for i in very_very_large_range
ssh_network_operation_with_paramiko(i)
Basically, using process or threads would be synonym of creating a fork bomb.
So is it possible to do perform asynchronous calls without creating threads or process like with ajax in JavaScript ? Because all I found currently involve creating threads or process were each of them perform only one function at time.
来源:https://stackoverflow.com/questions/33453581/asynchronous-method-call-in-python-without-creating-threads-or-forking-process