-
|
Best practices for managing the event loop to achieve optimal performance when using the Armeria framework in cases where the application can only create a limited number of platform threads. Hello, recently in a new project at our company, we decided to use Armeria. It is simple yet sufficiently feature-rich for our not-too-large projects. However, I am not yet familiar with the async and event loop approach, since previously I often used a thread-per-request model with other libraries. I would like to ask for best practices or some advice when programming with this framework in cases where my application can only create a small number of platform threads. I'm here to listen some advice from anyone 😊 |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
|
Hi, recently @novoj added a useful set of documentation/claude skill which addresses common pitfalls when doing async/event loop based development (although we haven't released the reflected info in our website yet). I think this can be a good starting point - if you have any further specific questions, I'm happy to answer as well. |
Beta Was this translation helpful? Give feedback.
-
|
Hello @longdq01 - site might not yet been regenerated, but the document is already on GitHub here: https://github.com/line/armeria/blob/main/site-new/src/content/docs/advanced/threading-model.mdx If you use Claude Code, you can also install new Armeria plugin with a skill that allows you to check your code for common bugs and pitfalls that might degrade your web service performance by blocking logic inside event loop sections. And don't hesitate to ask - Armeria has great supportive team that answer your questions and try to help quickly. |
Beta Was this translation helpful? Give feedback.
-
|
Thank you all for your enthusiastic support @novoj @jrhee17 . I’m new to this framework and don’t yet have much experience with async or threading. I hope to learn from your insights and use Armeria in future projects at my company. |
Beta Was this translation helpful? Give feedback.
-
|
Cuz i'm using Java21 so can I custom a virtual thread pools for blockingTaskExecutor ? Or I should bound with BlockingTaskExecutor builder |
Beta Was this translation helpful? Give feedback.
Right, you could probably inject a virtual-thread based
ExecutorServiceinto#blockingTaskExecutor-BlockingTaskExecutorBuilderunfortunately can't accommodate virtual-thread based executors at the moment.