I create a pool in this way:
pool = new ThreadPoolExecutor(1, 1, 1, TimeUnit.MINUTES, new ArrayBlockingQueue<Runnable>(20),new ThreadPoolExecutor.DiscardPolicy());
There was such a question: what would the call to pool.submit()
return if the task was sent to the account with a larger task queue size, in this case the 21st. Whether it returns normal Future, or null. In javadoc it is said that a RejectedException will be generated, but I have registered DiscardPolicy.