Skip to content

Interface IRuntime

Namespace: Cephalon.Engine.Runtime
Assembly: Cephalon.Engine.dll

Represents a built Cephalon runtime that can be initialized, started, restarted, stopped, and introspected by a host.

public interface IRuntime

Gets the failure policy that governs startup, stop, and restart behavior.

FailurePolicy FailurePolicy { get; }

FailurePolicy

Gets the most recent failure captured by the lifecycle state machine, if any.

RuntimeFailureInfo? LastFailure { get; }

RuntimeFailureInfo?

Gets the immutable manifest that was produced when the runtime was built.

RuntimeManifest Manifest { get; }

RuntimeManifest

Gets the ordered module set that participates in runtime lifecycle execution.

IReadOnlyList<IModule> Modules { get; }

IReadOnlyList<IModule>

Gets the richer operator-facing runtime story that explains what loaded, started, failed, and why.

RuntimeOperationalStory OperationalStory { get; }

RuntimeOperationalStory

Gets the number of successful manual restart attempts completed by the runtime.

int RestartCount { get; }

int

Gets the current lifecycle status of the runtime.

RuntimeStatus Status { get; }

RuntimeStatus

Gets the current status as a serializable snapshot.

RuntimeStatusSnapshot StatusSnapshot { get; }

RuntimeStatusSnapshot

InitializeAsync(IServiceProvider, CancellationToken)

Section titled “ InitializeAsync(IServiceProvider, CancellationToken)”

Initializes the runtime and all lifecycle-aware modules.

Task InitializeAsync(IServiceProvider services, CancellationToken cancellationToken = default)

services IServiceProvider

The service provider that modules should use during initialization.

cancellationToken CancellationToken

A token that can cancel the initialization operation.

Task

RestartAsync(IServiceProvider, CancellationToken)

Section titled “ RestartAsync(IServiceProvider, CancellationToken)”

Restarts the runtime when the configured failure policy allows it.

Task RestartAsync(IServiceProvider services, CancellationToken cancellationToken = default)

services IServiceProvider

The service provider that modules should use during the restart flow.

cancellationToken CancellationToken

A token that can cancel the restart operation.

Task

StartAsync(IServiceProvider, CancellationToken)

Section titled “ StartAsync(IServiceProvider, CancellationToken)”

Starts the runtime and all lifecycle-aware modules.

Task StartAsync(IServiceProvider services, CancellationToken cancellationToken = default)

services IServiceProvider

The service provider that modules should use during startup.

cancellationToken CancellationToken

A token that can cancel the start operation.

Task

If the runtime has not been initialized yet, the implementation may initialize it first.

Stops the runtime and all started lifecycle-aware modules.

Task StopAsync(CancellationToken cancellationToken = default)

cancellationToken CancellationToken

A token that can cancel the stop operation.

Task