Skip to navigation

nemo_gym.web.operation_runner

View as MarkdownOpen in Claude

Execution strategies for synchronous web-environment backends.

Module Contents

Classes

NameDescription
DirectWebOperationRunnerRun inexpensive or natively asynchronous-safe backend calls inline.
ThreadAffineWebOperationRunnerRun every operation on one dedicated thread.
WebOperationRunnerRun synchronous backend operations without prescribing a browser stack.

API

class nemo_gym.web.operation_runner.DirectWebOperationRunner()

Run inexpensive or natively asynchronous-safe backend calls inline.

nemo_gym.web.operation_runner.DirectWebOperationRunner.close() -> None
async
nemo_gym.web.operation_runner.DirectWebOperationRunner.run(
operation: typing.Callable[..., typing.Any],
args: typing.Any = ()
) -> typing.Any
async
class nemo_gym.web.operation_runner.ThreadAffineWebOperationRunner(
thread_name_prefix: str = 'web-runtime',
finalizer: typing.Callable[[], typing.Any] | None = None
)

Run every operation on one dedicated thread.

Playwright’s synchronous API is greenlet- and thread-affine. The dedicated thread keeps those calls off the FastAPI event loop. It is not the browser isolation boundary: headed desktop-control runtimes still scale as one resources-server process or container per DISPLAY.

_executor
nemo_gym.web.operation_runner.ThreadAffineWebOperationRunner.close() -> None
async
nemo_gym.web.operation_runner.ThreadAffineWebOperationRunner.run(
operation: typing.Callable[..., typing.Any],
args: typing.Any = ()
) -> typing.Any
async
class nemo_gym.web.operation_runner.WebOperationRunner()
Protocol

Run synchronous backend operations without prescribing a browser stack.

nemo_gym.web.operation_runner.WebOperationRunner.close() -> None
async
nemo_gym.web.operation_runner.WebOperationRunner.run(
operation: typing.Callable[..., typing.Any],
args: typing.Any = ()
) -> typing.Any
async