[concurrency-interest] Proposal for a CallerRunsExecutor in j.u.c.Executors

Zhong Yu zhong.j.yu at gmail.com
Mon Jun 23 22:19:33 EDT 2014


On Mon, Jun 23, 2014 at 5:39 PM, Martin Buchholz <martinrb at google.com> wrote:
> Since introducing a plain Executor is much better than doing nothing, let's
> start with that.

Is it necessary though? In java 8, programmers can simply use

    (Executor)Runnable::run

Pre java8, an anonymous class isn't too verbose either

    new Executor(){ public void execute(Runnable r) { r.run(); } }

It doesn't seem to warrant a convenience method in java.*.

Zhong Yu
bayou.io


More information about the Concurrency-interest mailing list