Class SandboxHostWorkerClient
Reference ISandboxWorkerClient that bridges a worker request to a worker-side SandboxHost. The worker independently re-prepares the plan from the transmitted module and policy instead of trusting the requesting host's signed plan, then executes it with the supplied (in-process) options. When the worker is hosted in a separate process, container, or restricted account, this provides a real out-of-process boundary with a documented envelope.
public sealed class SandboxHostWorkerClient : ISandboxWorkerClient, IDisposable
- Inheritance
-
SandboxHostWorkerClient
- Implements
- Inherited Members
Remarks
The supplied factory is invoked lazily once per client instance so worker-side plan, compiled, and hotness caches can survive across requests. The worker host's bindings must match the requesting host's bindings; otherwise the re-prepared identity hashes diverge and the requesting host fails the result closed. Re-preparation or execution failures are surfaced as a closed, fail-safe error result.
Constructors
SandboxHostWorkerClient(Func<SandboxHost>)
public SandboxHostWorkerClient(Func<SandboxHost> hostFactory)
Parameters
hostFactoryFunc<SandboxHost>
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
ExecuteInWorkerAsync(ExecutionPlan, string, SandboxValue, SandboxExecutionOptions, CancellationToken)
public ValueTask<SandboxExecutionResult> ExecuteInWorkerAsync(ExecutionPlan plan, string entrypoint, SandboxValue input, SandboxExecutionOptions options, CancellationToken cancellationToken = default)
Parameters
planExecutionPlanentrypointstringinputSandboxValueoptionsSandboxExecutionOptionscancellationTokenCancellationToken