这是Java中批处理请求的示例,其中我使用线程ID获取所有线程。这可以轻松满足您的需求。
BatchRequest b = service.batch();//callback function. (Can also define different callbacks for each request, as required)JsonBatchCallback<Thread> bc = new JsonBatchCallback<Thread>() { @Override public void onSuccess(Thread t, HttpHeaders responseHeaders) throws IOException { System.out.println(t.getMessages().get(0).getPayload().getBody().getData()); } @Override public void onFailure(GoogleJsonError e, HttpHeaders responseHeaders) throws IOException { }};// queuing requests on the batch requestsfor (Thread thread : threads) { service.users().threads().get("me", threads.getId()).queue(b, bc);}b.execute();
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)