So I am using executorservice to create a threadpool.
ExecutorService executor = Executors.newSingleThreadExecutor();
I am trying to access the number of tasks in the queue of the threadpool. I see that there are no methods to get that. I know there are methods to get the queue size in threadpoolexecutor but how can I do that with executorservice object.
Like I said I can get the queue information if I have created a ThreadpoolExecutor like this
ThreadPoolExecutor tpExecutor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS,new LinkedBlockingQueue<Runnable>());
I know I can use the tpExecutor.queue.size() to get the number of tasks in queue of threadpool. But currently I have declared my threadpool using Executor Service. How can I do that? It would be appreciable if people can write code and demonstrate.
Firebase Cloud Functions: PubSub, "res.on is not a function"
TypeError: Cannot read properties of undefined (reading 'createMessageComponentCollector')
I have a method that converts a image to buffered image
I have been working on a medical emergency project, which involves the use of android app to send alerts and a web app (AngularJS) as a control centre that can see alerts, location of request and keeps tracking the location, BackEnd is java maven
How I can resize Pane in GridPane? I'm creating a GUI which is GridPane and a map in itAnd when gui change it's size I want to map which is in another Pane to resize
So what my program is supposed to do is read user input and print out all the prime numbers leading up to itSo for example, if I input 20 it should print out 2, 3, 5, 7,