jsr370-experts@jax-rs-spec.java.net

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

From: Pavel Bucek <pavel.bucek_at_oracle.com>
Date: Tue, 11 Apr 2017 18:28:32 +0200

Hi Alessio,

yes, they are.

ScheduledExecutorService will be used for scheduling reconnects (that's
[2]) and provided executor service will be passed to RxInvokerProvider,
which is [1].

I guess you refer to methods rx(ExecutorService) and rx(...,
ExecutorService) - they were removed, so there is no need to handle
"priorities". (We don't need them any more, since you can set executor
service in ClientBuilder).

Regards,
Pavel


On 11/04/2017 18:14, Alessio Soldano wrote:
> Speaking of the javadoc, are the @see references at [1] and [2] correct ?
>
> [1]
> https://github.com/jax-rs/api/commit/cefcab15e097aa90484d832192fa5c7f2e42de8e#diff-8a8cfe7849b56b30a4878586901dfc52R257
> [2]
> https://github.com/jax-rs/api/commit/cefcab15e097aa90484d832192fa5c7f2e42de8e#diff-8a8cfe7849b56b30a4878586901dfc52R272
>
> And besides that, am I right in assuming that an ExecutorService
> instance provided as parameter to the getRxInvoker method in a
> RxInvokerProvider instance would take precedence over the
> executorService that's configured in the Client?
>
> Thanks
> Alessio
>
> Il 10/04/2017 18:08, Markus KARG ha scritto:
>> 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
>>
>>
>