Is there a Java class such that:
- Executable tasks can be added via an id, where all tasks with the same id are guaranteed to never run concurrently
- The number of threads can be limited to a fixed amount
A naive solution of a Map would easily solve (1), but it would be difficult to manage (2). Similarly, all thread pooling classes that I know of will pull from a single queue, meaning (1) is not guaranteed.
Solutions involving external libraries are welcome.