Skip to content

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

@Brico87

Description

@Brico87

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions