nemo_gym.web.browser_instance
nemo_gym.web.browser_instance
One browser session per process, reachable over HTTP.
A headed PyAutoGUI driver acts on its process’s X display, so one process can
serve one session at a time. A browser instance is such a process with its own
display: it hosts an unmodified web backend (driver plus evaluator) behind six
endpoints, and the resources server reaches it through RemoteWebBackend.
The resources server can then hold as many sessions as it has instances, while
every action still runs through the same driver code as a local session.
The server is single-threaded on purpose: Playwright’s synchronous API is thread-affine, so every backend call runs on the main thread.
Module Contents
Classes
Functions
Data
API
Bases: RuntimeError
The instance could not be reached or answered outside its protocol.
Forward the web backend protocol to one leased browser instance.
Calls are synchronous and run on the session’s operation-runner thread,
like the local backend they replace. The instance builds the real backend
on reset from the factory and configuration named here, so the
resources server and the instance always agree on driver and evaluator.
Bases: RuntimeError
Exit when the pool that spawned this instance is gone.