users@jax-rs-spec.java.net

[jax-rs-spec users] Re: JAX_RS_SPEC-523: ClientBuilder can set ExecutorService and ScheduledExecutorService

From: Markus KARG <markus_at_headcrashing.eu>
Date: Mon, 10 Apr 2017 18:08:55 +0200

This is great, particularly the fact that the JavaDocs clearly mandate the use of the Java EE Managed Executor Service! :-)
-Markus

-----Original Message-----
From: Pavel Bucek [mailto:pavel.bucek_at_oracle.com]
Sent: Montag, 10. April 2017 13:25
To: jsr370-experts_at_jax-rs-spec.java.net
Subject: JAX_RS_SPEC-523: ClientBuilder can set ExecutorService and ScheduledExecutorService

Dear experts,

following change was merged to the master branch:

https://github.com/jax-rs/api/commit/cefcab15e097aa90484d832192fa5c7f2e42de8e

It adds ClientBuilder#executorService and ClientBuilder#scheduledExecutorService. Also, couple of methods on RxInvoker were removed, since we don't need to pass Executor service in that way, it should be retrieved from the client runtime.

Simplest example would be:

ExecutorService executorService = Executors.newCachedThreadPool(); ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(256);

Client client =
   ClientBuilder.newBuilder()
                .executorService(executorService)
.scheduledExecutorService(scheduledExecutorService)
                .build();

feel free to share any comments or suggestions.

Thanks and regards,
Pavel