Principle:Ray project Ray Cross Language Task Submission
| Knowledge Sources | |
|---|---|
| Domains | Distributed_Computing, Cross_Language_Interop |
| Last Updated | 2026-02-13 17:00 GMT |
Overview
A task dispatch mechanism that routes function calls to workers of the appropriate programming language based on function descriptor metadata.
Description
Cross-Language Task Submission uses function descriptors (PyFunction, CppFunction) to route tasks to Python or C++ workers instead of Java workers. The runtime converts the descriptor to a FunctionDescriptor (PyFunctionDescriptor or CppFunctionDescriptor) that encodes the target language. The Raylet scheduler uses FunctionDescriptor.getLanguage() to dispatch the task to the correct language worker pool.
This reuses the same task submission pipeline as Java tasks but with different descriptor types and MessagePack-serialized arguments.
Usage
Pass a PyFunction or CppFunction descriptor to Ray.task() or Ray.actor() instead of a Java method reference. Arguments must be cross-language-compatible types.
Theoretical Basis
Cross-language dispatch extends the standard task submission pattern with language-based routing. The function descriptor carries the target language as metadata, and the scheduler routes to a worker process of the matching language.