nemo_rl.data_plane.async_utils#

Async dispatch helpers for local and Ray data-plane clients.

Module Contents#

Functions#

call_data_plane

Call a local data-plane client or a Ray actor exposing its methods.

API#

async nemo_rl.data_plane.async_utils.call_data_plane(
client: Any,
method_name: str,
*,
offload_sync: bool = False,
**kwargs: Any,
) Any#

Call a local data-plane client or a Ray actor exposing its methods.

Synchronous offloading is opt-in because it allows the actor event loop to issue other calls while this one is running. Callers should enable it only when that concurrency is supported or externally serialized.

Parameters:
  • client – Local DataPlaneClient or Ray actor handle.

  • method_name – Data-plane method to invoke.

  • offload_sync – Run a synchronous local implementation in a worker thread. Ray methods are already asynchronous and ignore this flag.

  • **kwargs – Keyword arguments forwarded to the data-plane method.

Returns:

The method result after awaiting Ray or coroutine results.