public abstract class CustomExecutionContext
extends java.lang.Object
implements scala.concurrent.ExecutionContextExecutor
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.ExecutionContext
public void execute(java.lang.Runnable command)
execute
in interface java.util.concurrent.Executor
execute
in interface scala.concurrent.ExecutionContext
public void reportFailure(java.lang.Throwable cause)
reportFailure
in interface scala.concurrent.ExecutionContext