Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RxInvokerProvider API unnecessarily restrictive #793

Open
olotenko opened this issue Sep 10, 2019 · 1 comment
Open

RxInvokerProvider API unnecessarily restrictive #793

olotenko opened this issue Sep 10, 2019 · 1 comment

Comments

@olotenko
Copy link

olotenko commented Sep 10, 2019

RxInvokerProvider.getRxInvoker receives a SyncInvoker. This makes no sense in modern world.

A consequence of this is that developers are enticed to use SyncInvoker interface, as is done by org/glassfish/jersey/client/JerseyCompletionStageRxInvoker.java, for example.

Proposal: update the API to require AsyncInvoker.

Expectation: RxInvoker should be as good as AsyncInvoker, just providing a better API with CompletionStages.

The issue here is that SyncInvoker can only start waiting for request in a thread, blocking the thread for the duration of the wait for response. AsyncInvoker is more suitable, since it allows to start using a thread only after the response started arriving. A well-designed system can work with asynchronous thread pool of CPU-count size. The use of SyncInvoker precludes that.

@spericas
Copy link
Contributor

Seems reasonable to me +1

@olotenko olotenko changed the title RxInvoker API unnecessarily restrictive RxInvokerProvider API unnecessarily restrictive Oct 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants