Class CoalescingChunkProvider
Chunk provider that coalesces multiple requests for the same chunk into a single request. This prevents redundant generation of the same chunk when multiple requests are made concurrently.
Implements
Inherited Members
Namespace: TerraProc.Core.Provider
Assembly: TerraProc.Core.dll
Syntax
public sealed class CoalescingChunkProvider : IChunkProvider
Constructors
| Edit this page View SourceCoalescingChunkProvider(IChunkProvider)
Chunk provider that coalesces multiple requests for the same chunk into a single request. This prevents redundant generation of the same chunk when multiple requests are made concurrently.
Declaration
public CoalescingChunkProvider(IChunkProvider provider)
Parameters
| Type | Name | Description |
|---|---|---|
| IChunkProvider | provider | Underlying chunk provider to use for generating chunks. |
Methods
| Edit this page View SourceGetAsync(ChunkCoords, CancellationToken)
Gets the chunk at the specified coordinates, coalescing multiple requests for the same chunk.
Declaration
public Task<ChunkData> GetAsync(ChunkCoords coords, CancellationToken ct = default)
Parameters
| Type | Name | Description |
|---|---|---|
| ChunkCoords | coords | Coordinates of the chunk to retrieve. |
| CancellationToken | ct | Cancellation token to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task<ChunkData> | Chunk data. |