public abstract class CustomExecutionContext
extends java.lang.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,
java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
void |
execute(java.lang.Runnable command) |
scala.concurrent.ExecutionContext |
prepare() |
void |
reportFailure(java.lang.Throwable cause) |
public CustomExecutionContext(akka.actor.ActorSystem actorSystem,
java.lang.String name)
public scala.concurrent.ExecutionContext prepare()
prepare in interface scala.concurrent.ExecutionContextpublic void execute(java.lang.Runnable command)
execute in interface java.util.concurrent.Executorexecute in interface scala.concurrent.ExecutionContextpublic void reportFailure(java.lang.Throwable cause)
reportFailure in interface scala.concurrent.ExecutionContext