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

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

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

import io.ray.api.PyActorHandle;
import io.ray.api.Ray;
import io.ray.api.function.PyActorClass;

/** A helper to create python actor. */
public class PyActorCreator extends BaseActorCreator {
  private final PyActorClass pyActorClass;
  private final Object[] args;

  public PyActorCreator(PyActorClass pyActorClass, Object[] args) {
    this.pyActorClass = pyActorClass;
    this.args = args;
  }

  public PyActorCreator setAsync(boolean isAsync) {
    builder.setAsync(isAsync);
    return this;
  }

  /**
   * Create a python actor remotely and return a handle to the created actor.
   *
   * @return a handle to the created python actor.
   */
  public PyActorHandle remote() {
    return Ray.internal().createActor(pyActorClass, args, buildOptions());
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy