playframework - Play 2 thread pools : default pool VS Akka Pool with Java -


according documentation, easier way use actor :

promise promiseofint = akka.future( new callable() { public integer call() { return ... ; } } );

but doc says java api use same thread pool (play default thread pool).

the documentation says there akka pool actors. how can send actor tasks akka thread pool, not block common user actions? able tune akka pool , keep default pool small.

thanks, loic

the java akka plugin (play.libs.akka) forwards scala plugin (play.api.libs.akka), in turn starts new actor system based on app's configuration. (that's plugin does.)

so configure actorsystem , dispatchers (a dispatcher executioncontext) using normal application.conf file based on akka config key. these dispatchers thread pools documentation referring to.

the default thread pool used when import play.api.libs.concurrent.execution.default. scala-only api. in java, executioncontext used automatically touch futures , promises. thread pool based on play's internal actor system, configured via play config key.

so in summary, actors, when created via akka plugin's actorsystem, automatically use akka thread pool (inside actor can refer using context.dispatcher).

outside actors, using play's default/internal thread pool.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -