我想从队列中提取多个文件并同时解析它们。但是,我的执行程序只调用一个线程:
private static ScheduledExecutorService parsingExec ;
protected static BlockingQueue<Path> queue = new LinkedBlockingQueue<>();
int threadPoolSize = 10;
parsingExec = Executors.newScheduledThreadPool(threadPoolSize);
parsingExec.scheduleAtFixedRate(new MyParser(queue), 0, 0, TimeUnit.MILLISECONDS);