Implementation:Ray project Ray ParallelActor Call
| Knowledge Sources | |
|---|---|
| Domains | Distributed_Computing, Java_API |
| Last Updated | 2026-02-13 16:00 GMT |
Overview
Type-safe static factory for creating parallel actors with constructor functions provided by the Ray Java API.
Description
Call is a class that provides numerous overloaded static actor() methods for creating parallel actors with constructor functions that accept 0 to 6 parameters. Each overload accepts a typed RayFunc constructor reference and its arguments (which may be direct values or ObjectRef references), packages them into an Object[] array, and returns a new ParallelActorCreator<A> instance. This file is auto-generated by ParallelActorCallGenerator.java.
Usage
Use this class as the base for ParallelActor to create parallel actors with compile-time type safety. It covers all permutations of argument counts and ObjectRef combinations up to 6 constructor parameters.
Code Reference
Source Location
- Repository: Ray
- File:
java/api/src/main/java/io/ray/api/parallelactor/Call.java
Signature
class Call {
public static <A> ParallelActorCreator<A> actor(RayFunc0<A> f);
public static <T0, A> ParallelActorCreator<A> actor(RayFunc1<T0, A> f, T0 t0);
public static <T0, A> ParallelActorCreator<A> actor(RayFunc1<T0, A> f, ObjectRef<T0> t0);
// ... overloaded actor() methods for up to 6 parameters with ObjectRef combinations
}
Import
import io.ray.api.parallelactor.Call;
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| f | RayFunc0<A> ... RayFunc6<T0..T5, A> |
Yes | A typed function reference for the actor constructor |
| t0..t5 | T0...T5 or ObjectRef<T> |
Varies | Arguments to the actor constructor, either direct values or object references |
Outputs
| Name | Type | Description |
|---|---|---|
| creator | ParallelActorCreator<A> |
A creator instance used to configure and instantiate the parallel actor |
Usage Examples
// Create a parallel actor with no constructor arguments
ParallelActorCreator<MyActor> creator = Call.actor(MyActor::new);
// Create a parallel actor with one constructor argument
ParallelActorCreator<MyActor> creator2 = Call.actor(MyActor::new, "config-value");
// Create a parallel actor with an ObjectRef argument
ObjectRef<String> configRef = Ray.put("config-value");
ParallelActorCreator<MyActor> creator3 = Call.actor(MyActor::new, configRef);