I have an application which creates a new thread on a socket connection. I would like to submit a Callable from this thread to an ExecutorService. The Callable needs to execute a program via a command line argument, so I don’t want to do this via the connection thread.
The problem is, I don’t know how to submit the Callable to an ExecutorService which has a set thread count.
I had considered doing this with a singleton and writing a submit method to submit my Callable to the ExecutorService instance but being unfamiliar with the api, I wasn’t sure if this was sensible.
Any help is greatly appreciated,
Thanks.
I would try