rlightning.env.env_server

Remote environment server for ZMQ-based environment control.

class rlightning.env.env_server.RemoteEnvServer(config: Any, worker_index: int | None = 0, preprocess_fn: Callable | None = None, **kwargs: Any)[source]

Bases: BaseEnv

ZMQ-backed environment server that brokers remote clients.

close() None[source]

Close the ZMQ server and background threads.

collect_async(timeout: float | None = None) List[EnvRet][source]

Collect clients’ returns

Parameters:

timeout (float | None) – timeout in seconds, None means blocking wait at least one return

Returns:

list of EnvRet from clients

Return type:

List[EnvRet]

get_action_space() Any | None[source]

Remote server does not expose action space directly.

get_address_port() Tuple[str, int][source]

Return the server address and port.

get_observation_space() Any | None[source]

Remote server does not expose observation space directly.

init() None[source]

Initialize ZMQ sockets and start background threads.

reset(*args: Any, **kwargs: Any) List[EnvRet][source]

Collect initial observations after environment initialization.

step(policy_resp: PolicyResponse) EnvRet[source]

Synchronous stepping is not supported on the server side.

step_async(policy_response_list: List[PolicyResponse]) None[source]

Step clients which env is in policy_response_list

Parameters:

policy_response_list (List[PolicyResponse]) – list of PolicyResponse for clients

Returns:

None