feat: add streaming primitives (IChunkRenderer, IJobExecutor, NeighborSnapshots, ChunkJob)
This commit is contained in:
15
World/Streaming/IJobExecutor.cs
Normal file
15
World/Streaming/IJobExecutor.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace VoxelEngine.World.Streaming;
|
||||
|
||||
public interface IJobExecutor
|
||||
{
|
||||
void Submit(Action work);
|
||||
}
|
||||
|
||||
public sealed class ThreadPoolJobExecutor : IJobExecutor
|
||||
{
|
||||
// Fire-and-forget: the Task is intentionally discarded. The caller's `work`
|
||||
// delegate MUST catch its own exceptions and report them via a dedicated
|
||||
// channel (e.g. ChunkJobResult.Error in the streaming pipeline). Unhandled
|
||||
// exceptions here are silently lost.
|
||||
public void Submit(Action work) => _ = Task.Run(work);
|
||||
}
|
||||
Reference in New Issue
Block a user