io.ray.api.parallelactor.ParallelActorCreator Maven / Gradle / Ivy
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);
}
}