Skip to main content

Class: Runtime

worker.Runtime

Core singleton representing an instance of the Rust Core SDK

Use install in order to customize the server connection options or other global process options.

Properties​

logger​

• Readonly logger: Logger


metricMeter​

• Readonly metricMeter: MetricMeter

The metric meter associated with this runtime.


metricsBuffer​

• Readonly metricsBuffer: undefined | MetricsBuffer

The metrics buffer associated with this runtime, if buffered metrics are enabled.

Buffered metrics is an experimental feature. APIs may be subject to change.


native​

• Readonly native: Runtime


options​

• Readonly options: CompiledRuntimeOptions


_instance​

▪ Static Optional _instance: Runtime


defaultOptions​

▪ Static defaultOptions: RuntimeOptions

Default options get overridden when Core is installed and are remembered in case Core is re-instantiated after being shut down


instantiator​

▪ Static Optional instantiator: "install" | "instance"

Methods​

flushLogs​

▸ flushLogs(): void

Flush any buffered logs.

Returns​

void


install​

▸ install(options): Runtime

Instantiate a new Core object and set it as the singleton instance

If Core has already been instantiated with instance or this method, will throw a IllegalStateError.

Parameters​

NameType
optionsRuntimeOptions

Returns​

Runtime


instance​

▸ instance(): Runtime

Get or instantiate the singleton Core object

If Core has not been instantiated with install or this method, a new Core instance will be installed and configured to connect to a local server.

Returns​

Runtime