Class PrewarmContext
Use case for prewarming a context by loading multiple assets simultaneously.
Optimizes performance by preloading assets that are likely to be needed together.
Inherited Members
Namespace: Serenity.AssetPrefetcher.Application.UseCases
Assembly: Serenity.AssetPrefetcher.Application.dll
Syntax
public class PrewarmContext : IAsyncUseCase<PrewarmContextInput>, IUseCase
Constructors
PrewarmContext(IAssetPrefetcherService)
Initializes the use case with the required asset prefetcher service.
Declaration
public PrewarmContext(IAssetPrefetcherService prefetcher)
Parameters
| Type | Name | Description |
|---|---|---|
| IAssetPrefetcherService | prefetcher | The asset prefetcher service to use for operations |
Methods
ExecuteAsync(PrewarmContextInput, CancellationToken)
Executes the context prewarming operation for multiple assets.
Declaration
public Task ExecuteAsync(PrewarmContextInput input, CancellationToken ct = default)
Parameters
| Type | Name | Description |
|---|---|---|
| PrewarmContextInput | input | Input containing context ID, asset keys, and policy |
| CancellationToken | ct |
Returns
| Type | Description |
|---|---|
| Task | Task representing the async prewarming operation |