I want to create a ThreadPoolExecutor such that when it has reached its maximum size and the queue is full, the submit() method blocks when trying to add new tasks. Do I need to implement a custom RejectedExecutionHandler for that or is there an existing way to do this using a standard Java library?
I want to create a ThreadPoolExecutor such that when it has reached its maximum
Share
One of the possible solutions I’ve just found:
Are there any other solutions? I’d prefer something based on
RejectedExecutionHandlersince it seems like a standard way to handle such situations.