Skip to main content

Module v8_host

Module v8_host 

Source
Expand description

V8 runtime host — manages a shared embedded V8 runtime with session multiplexing.

Structs§

V8RuntimeHost
Manages an embedded V8 runtime with session multiplexing.
V8SessionHandle
A handle to a single V8 session within the shared runtime. Provides methods for sending frames specific to this session.

Functions§

ensure_runtime_initialized
Pre-build the per-sidecar snapshot for an agent-SDK userland_code bundle into the process-wide cache, so the FIRST session that uses it is already warm. Uses the shared embedded runtime directly (no per-call host lifecycle). Blocks until built; idempotent (cache hit returns immediately); no-op for empty input. Eagerly initialize the process-wide embedded V8 runtime (and the V8 platform) on the calling thread. Call this once on a long-lived thread (the sidecar main thread) at startup so V8 is NOT first initialized on a transient worker thread (e.g. a VM-create pre-warm thread that then exits, which corrupts the platform).
pre_warm_agent_snapshot