public sealed class CompilerPoolRuns importers in worker processes, and survives one of them dying.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
The promise is crash isolation, and it is not the same promise an exception handler makes. ImportPipeline already catches an importer that throws and fails that one asset. What it cannot catch is an importer that takes the process down — a malformed FBX inside a C++ library, a stack overflow inside a recursive scene graph, a native access violation. Doc 08 calls that the difference between "one bad file" and "the editor won't open", and the only way to have it is a process boundary.
One pipe per worker, not one pipe with many instances. A shared pipe would need every message to carry a correlation id and every worker to be told which replies are its own; a pipe per worker makes a request and its response the only two things on that stream, so the framing is a length prefix and nothing else.
Artefacts come back over the wire rather than being written by the worker. N processes writing into one content-addressed store is a correctness problem — partial files, torn reads, no single place that knows what was written — for a saving that is a memory copy. The coordinator stays the only writer, which is also what keeps the cache and the sidecars in one copy.
What this does not yet buy is parallelism. The pool runs as many imports at once as it is given, and ImportPipeline hands it one at a time — because its sequential, path-ordered loop is what guarantees a dependent sees its dependency's new artefacts. Dispatching independent assets concurrently needs a scheduler that knows the dependency graph, and that is owed; see the README.
Fields and properties (2)
public int WorkerCountHow many workers it may run at once.
public int RestartsHow many times a worker has died and been replaced.
Methods (4)
public CompilerPool(string projectRoot, int workers = 0, IReadOnlyList<string>? workerCommand = null)Starts a pool over a project.
public static IReadOnlyList<string> DefaultCommand()How to start a worker when nobody said.
public ValueTask<ExecutedImport> ExecuteAsync(ImportJob job, CancellationToken cancellationToken = default(CancellationToken))Runs one import.
public void Dispose()Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Used by (3)
- CompilerPoolTestsVixen.AssetCompiler.Tests
- ImportRunnerVixen.Cli
- WorkerVixen.AssetCompiler