Callable<String> task = new Callable<String>() {
    @Override
    public String call() throws Exception {
        return HttpRequestUtil.host().doGet(requestUrl);
    }
};
ExecutorService executorService = Executors.newSingleThreadExecutor();
Future<String> future = executorService.submit(task);
String hostInfo = future.get(10,TimeUnit.SECONDS);

  

相关文章:

  • 2021-06-12
  • 2023-02-06
  • 2021-06-19
  • 2022-12-23
  • 2021-12-14
  • 2021-11-14
  • 2022-02-22
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-03
  • 2022-12-23
相关资源
相似解决方案