Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use custom executor service in a thread-controlled environment #86

Open
Brico87 opened this issue Oct 5, 2020 · 1 comment
Open

Use custom executor service in a thread-controlled environment #86

Brico87 opened this issue Oct 5, 2020 · 1 comment

Comments

@Brico87
Copy link

Brico87 commented Oct 5, 2020

In a thread-controlled environment, it could be great to provide our own ExecutorService instance in order to keep control over the thread pool instead of automatically instantiating a new newSingleThreadScheduledExecutor everytime we want to execute a command.

In the class ProcessExecutor, what do you think if we could have the possibility to do the following:

public StartedProcess start(ExecutorService providedService) throws IOException {
    WaitForProcess task = startInternal();
    ExecutorService service;
    if (providedService == null) {
        service = newExecutor(task);
    } else {
        service = providedService;
    }
    Future<ProcessResult> future = invokeSubmit(service, task);

This is not an issue but for us it appears as a limitation of the ProcessExecutor class.

@nemecec
Copy link
Collaborator

nemecec commented Feb 22, 2023

Would you be willing to send a pull request?
(Sorry for the long delay, I'm taking over maintenance of this project so communication should be faster from now on)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants