Skip to content

Class SandboxHostWorkerClient

Namespace: DotBoxD.Hosting
Assembly: DotBoxD.Hosting.dll

Reference DotBoxD.Hosting.ISandboxWorkerClient that bridges a worker request to a worker-side DotBoxD.Hosting.Execution.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

objectSandboxHostWorkerClient

ISandboxWorkerClient, IDisposable

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

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.

SandboxHostWorkerClient(Func<SandboxHost>)

Section titled “ SandboxHostWorkerClient(Func<SandboxHost>)”
public SandboxHostWorkerClient(Func<SandboxHost> hostFactory)

hostFactory Func<SandboxHost>

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

ExecuteInWorkerAsync(ExecutionPlan, string, SandboxValue, SandboxExecutionOptions, CancellationToken)

Section titled “ ExecuteInWorkerAsync(ExecutionPlan, string, SandboxValue, SandboxExecutionOptions, CancellationToken)”
public ValueTask<SandboxExecutionResult> ExecuteInWorkerAsync(ExecutionPlan plan, string entrypoint, SandboxValue input, SandboxExecutionOptions options, CancellationToken cancellationToken = default)

plan ExecutionPlan

entrypoint string

input SandboxValue

options SandboxExecutionOptions

cancellationToken CancellationToken

ValueTask<SandboxExecutionResult>