mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 06:15:23 +08:00
Java call Python actor method use actor.call (#7614)
This commit is contained in:
@@ -61,7 +61,7 @@ public class CrossLanguageInvocationTest extends BaseMultiLanguageTest {
|
||||
@Test
|
||||
public void testCallingPythonActor() {
|
||||
RayPyActor actor = Ray.createPyActor(PYTHON_MODULE, "Counter", "1".getBytes());
|
||||
RayObject res = Ray.callPy(actor, "increase", "1".getBytes());
|
||||
RayObject res = actor.call("increase", "1".getBytes());
|
||||
Assert.assertEquals(res.get(), "2".getBytes());
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ public class CrossLanguageInvocationTest extends BaseMultiLanguageTest {
|
||||
public static byte[] callPythonActorHandle(byte[] value) {
|
||||
// This function will be called from test_cross_language_invocation.py
|
||||
NativeRayPyActor actor = (NativeRayPyActor)NativeRayActor.fromBytes(value);
|
||||
RayObject res = Ray.callPy(actor, "increase", "1".getBytes());
|
||||
RayObject res = actor.call("increase", "1".getBytes());
|
||||
Assert.assertEquals(res.get(), "3".getBytes());
|
||||
return (byte[])res.get();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user