3 億の URL のリストがあります。この URL を使用して非同期 REST API 呼び出しを呼び出す必要があります。応答は必要ありません。これをtwistedで実装しようとしました。リストが1000を超えるURLで大きくなると、エラーが発生します。これを達成する方法を教えてください
Please find my code
# start of my program
from twisted.web import client
from twisted.internet import reactor, defer
#list of urls to be invoked
urls = [
'http://test.com/apiname/?s=85465&ts=1370591808',
'http://test.com/apiname/?s=85465&ts=1370591808',
'http://test.com/apiname/?s=85465&ts=1370591808',
'http://test.com/apiname/?s=85465&ts=1370591808',
'http://test.com/apiname/?s=85465&ts=1370591808',
'http://test.com/apiname/?s=85465&ts=1370591808',
'http://test.com/apiname/?s=85465&ts=1370591808',
'http://test.com/apiname/?s=85465&ts=1370591808'
]
#list of urls
#the call back
def finish(results):
for result in results:
print 'GOT PAGE', len(result), 'bytes'
reactor.stop()
waiting = [client.getPage(url) for url in urls]
defer.gatherResults(waiting).addCallback(finish)
reactor.run()