AKKA Futures and Java Themes

I have a question about using futures in one of the asked questions - Are futures executed in one thread? (Scala) . If a new / independent thread is used to achieve Future, what advantage does AKKA offer than Java threads? The number of web clients is limited by the maximum number of threads that the application can appear correctly? And the number of threads will be very less compared to the number of participants that the system can create. I just wanted to know if there are any other approaches so that when a huge number of requests come in, the system can handle them?

+4
source share
1 answer

Futuresperformed using ExecutionContext. There are several ways to build ExecutionContext. One of them is to create it with ExecutionService. For example, ExecutionServicemaybe ForkJoinPoolor ThreadPoolExecutor. Depending on the implementation, ExecutionServiceyour futures will be executed by creating a new one Threador reusing existing ones.

+8
source

Source: https://habr.com/ru/post/1607640/


All Articles