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

Automatically inter a blocking type for annotated servcies #5849

Open
ikhoon opened this issue Jul 31, 2024 · 0 comments
Open

Automatically inter a blocking type for annotated servcies #5849

ikhoon opened this issue Jul 31, 2024 · 0 comments

Comments

@ikhoon
Copy link
Contributor

ikhoon commented Jul 31, 2024

Armeria annotated services use an (service) event loop by default if @Blocking or .useBlockingTaskExecutor(true) is not set.

I think we can improve the static default value to dynamically determine if a blocking executor is necessary.

  • If a return type is not a known asynchronous type, such as CompletableFuture, Mono, Single, and so on, an (service) event loop is used by default.
  • If a return type is a non-IO type such as String, ResponseEntity or something else, a blocking task executor can be used for the methods by default.

This approach will be especially useful for users who are new to Armeria.
Related: #5848

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

1 participant