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

Decide to either execute code concurrently or not #33

Open
jakipatryk opened this issue Apr 26, 2023 · 1 comment
Open

Decide to either execute code concurrently or not #33

jakipatryk opened this issue Apr 26, 2023 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@jakipatryk
Copy link
Collaborator

Background

Currently in controllers we return CompletableFutures, but code is not executed concurrently (Tomcat's connection accepting threads are blocked by our code [authentication and services]). I don't think running services code (JWT generation etc.) is expensive-enough to have it concurrent though.

Feature

Decide whether to remove CompletableFuture (simplifies code), or try to do things concurrently (which is nontrivial as in Spring WebMVC it is impossible to perform authentication in another thread and something like Spring WebFlux would be needed).

I personally would prefer to not go with concurrency approach for this project and just remove CompletableFutures.

@jakipatryk jakipatryk added the help wanted Extra attention is needed label Apr 26, 2023
@dk1844
Copy link
Collaborator

dk1844 commented May 4, 2023

I don't think running services code (JWT generation etc.) is expensive-enough to have it concurrent though.
I agree with that. However, Wrapping with with a (Completable)Future gives you the ability to base your code on services with scala futures more easily, for-comprehend there/map etc - so I actually found it easier to integrate should that need arise.

If we are reasonably sure that we will mostly not need Futures in other layers, we can remove the futures in the controllers, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants