All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.ray.api.ActorHandle Maven / Gradle / Ivy

There is a newer version: 2.36.0
Show newest version
package io.ray.api;

/**
 * A handle to a Java actor.
 *
 * 

A handle can be used to invoke a remote actor method, with the {@code "call"} method. For * example: * *

{@code
 * class MyActor {
 *   public int echo(int x) {
 *     return x;
 *   }
 * }
 * // Create an actor, and get a handle.
 * ActorHandle myActor = Ray.actor(MyActor::new).remote();
 * // Call the `echo` method remotely.
 * ObjectRef result = myActor.task(MyActor::echo, 1).remote();
 * // Get the result of the remote `echo` method.
 * Assert.assertEqual(result.get(), 1);
 * }
* *

Note, the {@code "call"} method is defined in {@link ActorCall} interface, with multiple * overloaded versions. * * @param The type of the concrete actor class. */ public interface ActorHandle extends BaseActorHandle, ActorCall {}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy