【发布时间】:2012-11-01 06:41:05
【问题描述】:
我创建了一个充当自动购买者的应用程序。使其尽可能快对于比其他任何人更快地到达该项目至关重要。我正在使用无限循环(即 for(;;))发出连续的 http 请求,然后解析 JSON 结果。
有谁知道如何同时发出多个请求?我目前每秒处理大约 3 个请求。 java也不适合这种应用程序吗?我应该考虑使用另一种语言吗?
非常感谢你!
编辑:我使用类似的搜索功能
for(;;){
search(323213, 67);
search(376753, 89);
}
public void search(int itemID, int maxPrice) {
// sets the http request with the need cookies and headers
// processes the json. If (itemId==x&&maxPrice>y) ==> call buy method
}
【问题讨论】:
标签: java json performance http request