Play Queue Queue

How does the game handle asynchronous jobs when called using the now () method?

Are they executed immediately or stored in a queue and processed by a fixed number of threads? What control do we have over this?

+6
source share
1 answer

When you call now() , your work is placed in the ScheduledThreadPoolExecutor via submit() . Since the contractor uses a fixed-size pool, your task may be in the queue. In addition, the pool is shared with your scheduled tasks , so you may encounter them in addition to any tasks that you spawned upon request.

You can adjust the pool size in the application configuration using the play.jobs.pool parameter. The default value is 10.

+6
source

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


All Articles