mirror of
https://github.com/wassname/ray.git
synced 2026-06-29 16:32:21 +08:00
[Java] Add killActor API in Java (#6728)
* Add killActor API in Java * fix javadoc * update test case * Address comments
This commit is contained in:
@@ -130,6 +130,7 @@ public final class Ray extends RayCall {
|
||||
|
||||
/**
|
||||
* Set the async context for the current thread.
|
||||
*
|
||||
* @param asyncContext The async context to set.
|
||||
*/
|
||||
public static void setAsyncContext(Object asyncContext) {
|
||||
@@ -180,6 +181,16 @@ public final class Ray extends RayCall {
|
||||
runtime.setResource(resourceName, capacity, UniqueId.NIL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Kill the actor immediately. This will cause any outstanding tasks submitted to the actor to
|
||||
* fail and the actor to exit in the same way as if it crashed.
|
||||
*
|
||||
* @param actor The actor to be killed.
|
||||
*/
|
||||
public static void killActor(RayActor<?> actor) {
|
||||
runtime.killActor(actor);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the runtime context.
|
||||
*/
|
||||
|
||||
@@ -76,6 +76,13 @@ public interface RayRuntime {
|
||||
*/
|
||||
void setResource(String resourceName, double capacity, UniqueId nodeId);
|
||||
|
||||
/**
|
||||
* Kill the actor immediately.
|
||||
*
|
||||
* @param actor The actor to be killed.
|
||||
*/
|
||||
void killActor(RayActor<?> actor);
|
||||
|
||||
/**
|
||||
* Invoke a remote function.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user