public abstract class CustomExecutionContext extends Object implements scala.concurrent.ExecutionContextExecutor
Subclass this to create your own custom execution context, using the full path to the Akka dispatcher.
class MyCustomExecutionContext extends CustomExecutionContext {
// Dependency inject the actorsystem from elsewhere
public MyCustomExecutionContext(ActorSystem actorSystem) {
super(actorSystem, "full.path.to.my-custom-executor");
}
}
Then use your custom execution context where you have blocking operations that require processing
outside of Play's main rendering thread.Constructor and Description |
---|
CustomExecutionContext(akka.actor.ActorSystem actorSystem,
String name) |
Modifier and Type | Method and Description |
---|---|
void |
execute(Runnable command) |
scala.concurrent.ExecutionContext |
prepare() |
void |
reportFailure(Throwable cause) |
public CustomExecutionContext(akka.actor.ActorSystem actorSystem, String name)
public scala.concurrent.ExecutionContext prepare()
prepare
in interface scala.concurrent.ExecutionContext
public void execute(Runnable command)
public void reportFailure(Throwable cause)
reportFailure
in interface scala.concurrent.ExecutionContext