users@jax-rs-spec.java.net

[jax-rs-spec users] Re: [PLEASE REVIEW] JAX-RS Client Reactive API -- updated

From: Santiago Pericasgeertsen <santiago.pericasgeertsen_at_oracle.com>
Date: Fri, 20 Jan 2017 09:42:55 -0500

Hi Pavel,

> On Jan 20, 2017, at 9:12 AM, Pavel Bucek <pavel.bucek_at_oracle.com> wrote:
>
> Dear experts,
>
> thanks for your feedback!
> Last suggestion by Santiago (doing lookup by the RxInvoker subclass) is implementable and I believe it is the best one we do have.
>
> Code example (extensibility support):
>
> Client rxClient = client.register(CompletionStageRxInvokerProvider.class, RxInvokerProvider.class);

 What is the RxInvokerProvider.class above?

— Santiago
>
> CompletionStage<List<String>> cs =
> rxClient.target("remote/forecast/{destination}")
> .resolveTemplate("destination", "mars")
> .request()
> .header("Rx-User", "Java8")
> .rx(CompletionStageRxInvoker.class)
> .get(new GenericType<List<String>>() {
> });
>
> cs.thenAccept(System.out::println);
> Corresponding pull request: https://github.com/jax-rs/api/pull/3 <https://github.com/jax-rs/api/pull/3>
> Please review the pull request and provide your comments and suggestions.
>
> Thanks and have a nice weekend,
> Pavel
>
>
>
> On 19/01/2017 16:54, Santiago Pericasgeertsen wrote:
>> Hi Pavel,
>>
>> Just catching up with this issue. I guess the two levels of indirection has led us into a generic wall :)
>>
>>
>>> Client rxClient = client.register(CompletionStageRxInvokerProvider.class);
>>> CompletionStage<UserPojo> cs =
>>> rxClient.target("http://foo.bar" <http://foo.bar/>)
>>> .request()
>>> .rx(CompletionStage.class)
>>> .get(UserPojo.class);
>> So what if we reduce indirection and write:
>>
>> .rx(CompletionStageRxInvoker.class)
>>
>> as before, still keeping the provider for it? Less ideal of course.
>>
>> — Santiago
>>
>