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

io.ray.api.call.PyActorTaskCaller Maven / Gradle / Ivy

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

import io.ray.api.ObjectRef;
import io.ray.api.PyActorHandle;
import io.ray.api.Ray;
import io.ray.api.function.PyActorMethod;

/**
 * A helper to call python actor method.
 *
 * @param  The type of the python actor method return value
 */
public class PyActorTaskCaller {
  private final PyActorHandle actor;
  private final PyActorMethod method;
  private final Object[] args;

  public PyActorTaskCaller(PyActorHandle actor, PyActorMethod method, Object[] args) {
    this.actor = actor;
    this.method = method;
    this.args = args;
  }

  /**
   * Execute a python actor method remotely and return an object reference to the result object in
   * the object store.
   *
   * @return an object reference to an object in the object store.
   */
  @SuppressWarnings("unchecked")
  public ObjectRef remote() {
    return Ray.internal().callActor(actor, method, args);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy