Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Play framework job queue

How does play handle asynchronous jobs when they are called using the now() method?

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

like image 458
Rand Avatar asked Jun 01 '11 02:06

Rand


1 Answers

When you call now(), your job is put into a ScheduledThreadPoolExecutor via submit(). Since the executor uses a fixed-size pool, your job may end up being queued. Also, the pool is shared with your scheduled jobs , so you may have contention with them in addition to any jobs you spawned on demand.

You can adjust the size of the pool in your application's configuration, using the play.jobs.pool setting. The default value is 10.

like image 182
Tim Stone Avatar answered Oct 18 '22 05:10

Tim Stone