logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class InitializationPipelineService

    Orchestrates the execution of a series of initialization tasks, respecting their criticality and weight.

    Inheritance
    object
    InitializationPipelineService
    Implements
    IService
    IFoundationSettings
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.InitializationPipeline.Application.Services
    Assembly: Serenity.InitializationPipeline.Application.dll
    Syntax
    public class InitializationPipelineService : IService, IFoundationSettings

    Constructors

    InitializationPipelineService(IEnumerable<ITask>, ISkipPolicy, IInitializationPipelineTelemetry, ILogService)

    Initializes the pipeline with the provided tasks, skip policy, and optional telemetry.

    Declaration
    public InitializationPipelineService(IEnumerable<ITask> tasks, ISkipPolicy skipPolicy, IInitializationPipelineTelemetry telemetry, ILogService logService)
    Parameters
    Type Name Description
    IEnumerable<ITask> tasks

    Collection of initialization tasks to execute

    ISkipPolicy skipPolicy

    Policy to determine if certain tasks can be skipped

    IInitializationPipelineTelemetry telemetry

    Optional telemetry interface for monitoring progress

    ILogService logService
    Remarks

    Tasks with non-positive weight will default to a weight of 1.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if tasks or skipPolicy is null

    Properties

    Guid

    Declaration
    public string Guid { get; set; }
    Property Value
    Type Description
    string

    Id

    Declaration
    public string Id { get; set; }
    Property Value
    Type Description
    string

    LogService

    Declaration
    public ILogService LogService { get; set; }
    Property Value
    Type Description
    ILogService

    Outcome

    Declaration
    public InitializationPipelineOutcome Outcome { get; }
    Property Value
    Type Description
    InitializationPipelineOutcome

    The terminal state of the last RunAsync(CancellationToken) invocation — the halt, the halting task's id and its exception included — so the game can observe a halted boot instead of inferring it from log text. NotStarted until the first run ends.

    Methods

    BuildPlan()

    Builds a plan representing the sequence and characteristics of the tasks to be executed.

    Declaration
    public IReadOnlyList<InitializationPipelineStep> BuildPlan()
    Returns
    Type Description
    IReadOnlyList<InitializationPipelineStep>

    A read-only list of initialization pipeline steps.

    RunAsync(CancellationToken)

    Executes the initialization pipeline asynchronously, respecting task criticality and skip policy.

    Declaration
    public Task<bool> RunAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    Cancellation token to cancel the operation

    Returns
    Type Description
    Task<bool>

    True if all critical tasks completed successfully; otherwise, false.

    Remarks

    A failing task whose criticality HaltsOnFailure(TaskCriticality) admits stops the run: every remaining task is counted skipped without running, exactly as Simulate(IReadOnlyList<InitializationPipelineStep>, IReadOnlyList<bool>) projects it. Non-critical task failures do not halt the pipeline execution.

    Exceptions
    Type Condition
    OperationCanceledException

    Thrown if the operation is canceled via the cancellation token.

    Implements

    IService
    IFoundationSettings
    In this article
    © 2026 Serenity. All Rights Reserved