我循环了1万次,可是后台只打印了64行日志?怎么回事?
public static void main(String[] args) throws ExecutionException, InterruptedException {
Sender.setup(null);
List<Future> list = new ArrayList<Future>();
for (int i = 0; i < 10000; i++) {
Request req = Request.create("https://github.com/nutzam/nutz", Request.METHOD.POST);
Future<Response> response = Sender.create(req).setTimeout(7 * 1000).send(new Callback<Response>() {
Stopwatch sw = Stopwatch.begin();
public void invoke(Response resp) {
sw.stop();
System.out.println(Thread.currentThread().getName() + " " + sw.toString());//怎么只打印了64个?
}
});
list.add(response);
}
int i = 0;
for (Future f : list) {
System.out.println(++i + "");
}
Sender.shutdown();
}