nemo_gym.agent_utils.ordered_operations
nemo_gym.agent_utils.ordered_operations
In-process exactly-once ordered operations for agent activations.
Module Contents
Classes
API
Bases: ValueError
An activation conflicts with its session’s ordering or immutable input.
Join/replay identical calls, reject conflicts, and fence work before closing.
Owners must serialize seed/close binding separately and retain this ledger for the session lifetime. Disconnecting a waiter leaves execution alive. Failed operations are retained and replay their failure; a new physical episode is needed to retry with different inputs. This is process-local, not crash recovery.
Fence new work, cancel/await the active operation, then allow owner cleanup.
A timeout retains the active task and the fence, so cleanup cannot be declared successful while an activation might still launch remotely.
Run the next operation once or join an exact retry, without holding the lock while running.