[Java] add exitActor API for java (#10496)

This commit is contained in:
chaokunyang
2020-09-04 10:11:42 +08:00
committed by GitHub
parent 5e4db6ad24
commit cf3875bd8c
11 changed files with 195 additions and 0 deletions
@@ -241,4 +241,16 @@ public final class Ray extends RayCall {
PlacementStrategy strategy) {
return runtime.createPlacementGroup(bundles, strategy);
}
/**
* Intentionally exit the current actor.
* <p>
* This method is used to disconnect an actor and exit the worker.
*
* @throws RuntimeException An exception is raised if this is a driver or this worker is not
* an actor.
*/
public static void exitActor() {
runtime.exitActor();
}
}
@@ -193,4 +193,9 @@ public interface RayRuntime {
* @return The wrapped callable.
*/
<T> Callable<T> wrapCallable(Callable<T> callable);
/**
* Intentionally exit the current actor.
*/
void exitActor();
}