关于多线程的使用

来源:互联网 发布:怎么改mac的用户名 编辑:程序博客网 时间:2024/06/16 10:05
 // 推送索引使用    private ExecutorService asynTaskExecutor = Executors.newFixedThreadPool(DEFAULT_THREAD_COUNT,            new NamedThreadFactory("Background-PushCmmdty2Solr"));    List<Future<SolrIndexDealResult>> futureList = new ArrayList<>();    List<Callable<SolrIndexDealResult>> callables = Lists.newArrayList();    // 批量处理            futureList = asynTaskExecutor.invokeAll(callables);
阅读全文
0 0