Do not break actor containment
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / RaftActorContext.java
index b5f3afdc16839252f2f2069986e3ef5955c995ae..e971ed4f6de95d5d53d02e7eeb9d3d6c89628db6 100644 (file)
@@ -15,6 +15,7 @@ import akka.cluster.Cluster;
 import com.google.common.annotations.VisibleForTesting;
 import java.util.Collection;
 import java.util.Optional;
+import java.util.concurrent.Executor;
 import java.util.function.Consumer;
 import java.util.function.LongSupplier;
 import org.eclipse.jdt.annotation.NonNull;
@@ -64,6 +65,13 @@ public interface RaftActorContext {
      */
     ActorRef getActor();
 
+    /**
+     * Return an Executor which is guaranteed to run tasks in the context of {@link #getActor()}.
+     *
+     * @return An executor.
+     */
+    @NonNull Executor getExecutor();
+
     /**
      * The akka Cluster singleton for the actor system if one is configured.
      *