I'm using Java EE and Spring and I have a method with a ProcessBuilder
inside:
private void conversion(String path, String name, String timeSample, String timeout) throws Exception {
ProcessBuilder pb = new ProcessBuilder("java", "-jar", "Conversion.jar", path, name, timeSample, timeout);
so each time I call this method it creates a new process.
These processes take a lot of resources so I would like to have up to 5 processes running simultaneously
I call the method inside an async method so the user isn't aware about the waiting.
Is there a simple solution or I have to implement a queue where insert all the request and manage them? Thanks