createRuntimeServices(options?: CreateRuntimeServicesOptions): IRuntimeServices
Creates runtime services for the current platform.
Use this when runtime services are needed before an application is
constructed — reading environment variables to build configuration, for
example. Inside an application, resolve CAPABILITIES.RUNTIME from the
service registry instead: RuntimePlugin registers the instance it builds
through this same function.
The returned services are a stateless facade over platform globals, so building a second instance alongside the application's own is safe: they hold no connection, no cache, and no handle registry, and nothing compares them by identity.
One caveat worth knowing rather than discovering: env is a snapshot taken
at construction, not a live view. Two instances built at different moments
observe the environment as it was at each of those moments, so a variable set
in between is visible only to the later one.
On Cloudflare Workers there is no ambient environment to snapshot, so env
stays empty unless CreateRuntimeServicesOptions.env is supplied.
options: CreateRuntimeServicesOptions
Platform override and adapter injection