logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Interface IAssetPrefetcherApp

    Application layer port for asset prefetching operations. Provides the main API that UI and gameplay systems use to declare prefetch intentions. Orchestrates use cases without exposing Addressables or infrastructure details.

    Namespace: Serenity.AssetPrefetcher.Application.Interfaces
    Assembly: Serenity.AssetPrefetcher.Application.dll
    Syntax
    public interface IAssetPrefetcherApp

    Methods

    PrefetchOneAsync(PrefetchAssetInput, CancellationToken)

    Prefetches a single asset with specified priority and context.

    Declaration
    Task PrefetchOneAsync(PrefetchAssetInput input, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    PrefetchAssetInput input

    Input containing asset key, priority, and context information

    CancellationToken cancellationToken

    Cancellation token for the async operation

    Returns
    Type Description
    Task

    Task representing the async prefetch operation

    PrewarmContextAsync(PrewarmContextInput, CancellationToken)

    Preloads assets for a specific context to improve performance.

    Declaration
    Task PrewarmContextAsync(PrewarmContextInput input, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    PrewarmContextInput input

    Input containing context and asset information

    CancellationToken cancellationToken

    Cancellation token for the async operation

    Returns
    Type Description
    Task

    Task representing the async prewarming operation

    QueryCacheStatusAsync(QueryCacheStatusInput, CancellationToken)

    Performs a lightweight query of cache status for a set of asset keys.
    Provides information about which assets are cached and their current state.

    Declaration
    Task<IReadOnlyDictionary<AssetKey, CacheStatusOutput>> QueryCacheStatusAsync(QueryCacheStatusInput input, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    QueryCacheStatusInput input

    Input containing asset keys to query

    CancellationToken cancellationToken

    Cancellation token for the async operation

    Returns
    Type Description
    Task<IReadOnlyDictionary<AssetKey, CacheStatusOutput>>

    Dictionary mapping asset keys to their cache status information

    ReleaseContext(ReleaseContextInput)

    Releases all assets associated with a specific context from cache.

    Declaration
    void ReleaseContext(ReleaseContextInput input)
    Parameters
    Type Name Description
    ReleaseContextInput input

    Input containing context information to release

    UpdateTargetAsync(UpdateTargetInput, CancellationToken)

    Updates the target configuration for prefetch operations.

    Declaration
    Task UpdateTargetAsync(UpdateTargetInput input, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    UpdateTargetInput input

    Input containing updated target configuration

    CancellationToken cancellationToken

    Cancellation token for the async operation

    Returns
    Type Description
    Task

    Task representing the async update operation

    In this article
    © 2026 Serenity. All Rights Reserved