Java call Python actor method use actor.call (#7614)

This commit is contained in:
fyrestone
2020-03-17 14:52:43 +08:00
committed by GitHub
parent ffa9df4683
commit 7697ea2be2
10 changed files with 127 additions and 46 deletions
@@ -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();
}