Skip to main content

Module registry

Module registry 

Source
Expand description

SQLite-backed registry of running browser instances.

Re-exports§

pub use bidi_lock::BidiLockBusy;
pub use bidi_lock::BidiLockGuard;
pub use bidi_lock::BidiLockRow;
pub use scratches::ScratchRow;
pub use tabs::TabRow;

Modules§

bidi_lock
bidi_locks SQLite table: arbitrates the Firefox single-BiDi-session limit across concurrent CLI processes.
naming
Friendly-name generator for browser instances.
schema
SQLite schema for the browser registry.
scratches
scratches SQLite table: one row per browser, holding the daemon-style scratch tab’s target_id. Used by lock-free ops (eval, fetch with no explicit tab) so the default code path never touches a user-visible tab — the architectural answer to the iLO failure mode (an admin tab whose renderer ignores Runtime.evaluate could otherwise be silently picked by the default selector).
tabs
tabs SQLite table: named tab handles addressable as <browser>/<name> across the CLI. Backs the tab open / tab list subcommands and the cross-command <browser>/<name> positional routing.
words
Friendly word list used for browser instance naming.

Structs§

BrowserRow
One row in the browsers table.
Registry
SQLite registry handle. SQLite-level WAL + busy_timeout handles concurrent reader/writer coordination across processes; we no longer hold a long-lived exclusive file lock for the lifetime of the handle. A short exclusive lock is taken only across the schema-migration window in open_at to serialise initial CREATE TABLE / CREATE INDEX against a concurrent first open.

Functions§

format_unix_seconds_as_iso8601
Format a Unix epoch second count as YYYY-MM-DDTHH:MM:SSZ.
is_alive
Liveness check: PID exists AND a TCP connect to the local port succeeds.
now_epoch_s
Current Unix epoch seconds.
now_iso8601
Current time formatted as YYYY-MM-DDTHH:MM:SSZ (UTC).
pid_alive
Cheap check: is process pid still running on this machine? Used by stale-row eviction in scratches, tabs, and bidi_locks to avoid keeping rows registered to a crashed CLI process.