0
これはコードの縮小版です。私はhttp_client.fetchを使用して100を超えるリクエストを作成しています。ランダムな順序でレスポンスを取得しています。どのレスポンスがどのリクエストに対応しているかを知ることは本当に重要です。これを達成するために変更する必要がありますか?竜巻ライブラリを使用しているときに特定の応答のリクエストを見つけるにはどうすればよいですか?
from tornado import ioloop, httpclient
def handle_request(response):
jsonobject_ticker = json.loads(response.body, object_hook= JSONObject)
currency_price=jsonobject_ticker.result.Last
print "{0:.9f}".format(currency_price)
global i
i -= 1
if i == 0:
ioloop.IOLoop.instance().stop()
def check_for_pump():
for index in range (len(shortlisted)):
market=shortlisted[index]
print market
http_client = httpclient.AsyncHTTPClient()
global i
i += 1
http_client.fetch(get_ticker_url(shortlisted[index]), handle_request, method='GET')
デイビス!それは私のために完全に働いた!私はあなたが言及したように "部分的な"方法を使用しました。 – user3714163