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

io.ray.api.parallelactor.ParallelActorCreator Maven / Gradle / Ivy

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

import io.ray.api.Ray;
import io.ray.api.function.RayFuncR;

public class ParallelActorCreator {

  private int parallelism = 1;

  private RayFuncR func;

  private Object[] args;

  public ParallelActorCreator(RayFuncR func, Object[] args) {
    this.func = func;
    this.args = args;
  }

  public ParallelActorCreator setParallelism(int parallelism) {
    this.parallelism = parallelism;
    return this;
  }

  public ParallelActorHandle remote() {
    ParallelActorContext ctx = Ray.internal().getParallelActorContext();
    return ctx.createParallelActorExecutor(parallelism, this.func);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy