多个并发URL调用 [英] several concurrent URL calls
问题描述
如何并行执行 N
个url调用,并在返回时处理响应?
<我想准备响应并将它们打印到屏幕上,也许经过一些操作。
我不在乎响应的顺序。
您可以为此使用Twisted Python如此处的示例所示: https://twistedmatrix.com/documents /13.0.0/web/howto/client.html#auto3
Twisted是适用于Python的异步编程库,可让您在同时,,它带有一个HTTP客户端(和服务器)。
How can I make, say N
url calls in parallel, and process the responses as they come back?
I want to ready the responses and print them to the screen, maybe after some manipulations. I don't care about the order of the responses.
You can use Twisted Python for this, such as in the example here: https://twistedmatrix.com/documents/13.0.0/web/howto/client.html#auto3
Twisted is an asynchronous programming library for Python which lets you carry out multiple actions "at the same time," and it comes with an HTTP client (and server).
这篇关于多个并发URL调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!