You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by ideal <ye...@gmail.com> on 2018/12/09 05:14:15 UTC

[exec] Add stream api to improve exec ease of use

Hi all, the current use of java8 has been very extensive. I designed a
stream api based simplified `exec` and verified its usability in a lot of
scenarios. Share my api now.

demo:

        JVMLauncher<Integer> launcher = JVMLaunchers.<Integer>newJvm()
                .setCallable(() -> {
                    System.out.println("************ exec task jvm
start ***************");
                    TimeUnit.SECONDS.sleep(1);
                    System.out.println("************ exec task jvm
stop ***************");
                    return 1;
                })
                .setXms("16m")
                .setXmx("16m")
                .addUserjars(Collections.emptyList())
                .setConsole((msg) -> System.err.println(msg))
                .build();

        VmFuture<Integer> out = launcher.startAndGet();   --run

Re: [exec] Add stream api to improve exec ease of use

Posted by Gilles <gi...@harfang.homelinux.org>.
Hello.

On Sun, 9 Dec 2018 13:14:15 +0800, ideal wrote:
> Hi all, the current use of java8 has been very extensive. I designed 
> a
> stream api based simplified `exec` and verified its usability in a 
> lot of
> scenarios. Share my api now.
>
> demo:
>
>         JVMLauncher<Integer> launcher = 
> JVMLaunchers.<Integer>newJvm()
>                 .setCallable(() -> {
>                     System.out.println("************ exec task jvm
> start ***************");
>                     TimeUnit.SECONDS.sleep(1);
>                     System.out.println("************ exec task jvm
> stop ***************");
>                     return 1;
>                 })
>                 .setXms("16m")
>                 .setXmx("16m")
>                 .addUserjars(Collections.emptyList())
>                 .setConsole((msg) -> System.err.println(msg))
>                 .build();
>
>         VmFuture<Integer> out = launcher.startAndGet();   --run

It seems that the [exec] component has become unmaintained: last
release happened more than 4 years ago.

In order to make it worth reviving it (if there people willing
to do it), it would be useful to list what your project provides
that is missing from recent Java versions (e.g. enhancements to
the "Process"-related JDK classes).

Thanks,
Gilles


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org