Asynchronous method call in Python without creatin

2019-02-19 04:27发布

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.

0条回答
登录 后发表回答