GitHub user harbby opened a pull request:
https://github.com/apache/commons-lang/pull/345
add jvmLaunchers
When you need to perform some operations through a child process, it is
very cumbersome and requires a lot of coding. I have an api below to simplify
this process and make it elegant
Like this: The Callable event is executed by the child process (jvm)
```java
JVMLauncher<Integer> launcher = JVMLaunchers.<Integer>newJvm()
.setCallable(() -> {
System.out.println("************ Compile start
***************");
TimeUnit.SECONDS.sleep(1);
System.out.println("************ Compile stop
***************");
return 1;
})
.addUserjars(Collections.emptyList())
.setConsole((msg) -> System.err.println(msg))
.build();
VmFuture<Integer> out = launcher.startAndGet();
```
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/harbby/commons-lang master
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/commons-lang/pull/345.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #345
----
commit 7a6b16315899b958d775e093bb56d42cb7a558c3
Author: ideal <125553253@...>
Date: 2018-08-23T02:44:54Z
add jvmLaunchers
----
---