Vixen
02b45cc4
csharp
public interface IRealmPlacement

How a realm process comes into existence, whatever is running underneath.

Read the guide page for this →

Remarks

ADR-019. Three backends — Kubernetes, Docker, Process — probed in that order at startup, with the first that answers winning and configuration able to override. The interface is small on purpose: everything above it reasons about shards, and the only thing it needs from the world below is that a process with a given RealmSpec exists, can be told to stop, and can be watched.

⚠ Nothing here is on a frame path, which is why every method is asynchronous without apology. Starting a pod is seconds; ADR-016's rule about never awaiting the control plane from a tick is what keeps that acceptable.

Placement.Process is to this document what Vixen.Net.Transport.Local is to doc 16 — the backend that makes the whole system an ordinary unit test rather than an integration environment. A test that needs eight realms starts eight processes on a laptop, deterministically, and asserts against the same interface production uses.

Methods (5)

  • ValueTask<PlacementProbe> ProbeAsync(CancellationToken cancellation)

    Whether this backend can run here, and what it found.

  • ValueTask<RealmInstance> StartAsync(RealmSpec spec, CancellationToken cancellation)

    Brings a realm up.

  • ValueTask StopAsync(RealmInstanceId instance, StopMode mode, CancellationToken cancellation)

    Takes a realm down.

  • ValueTask<IReadOnlyList<RealmInstance>> ListAsync(CancellationToken cancellation)

    What this backend believes is running.

  • IAsyncEnumerable<PlacementEvent> WatchAsync(CancellationToken cancellation)

    Everything that happens to instances, as it happens.

Used by (6)

  • DockerPlacementVixen.Live.Placement.Docker
  • KubernetesPlacementVixen.Live.Placement.Kubernetes
  • MapGrainVixen.Live.Orchestrator
  • MapOptionsVixen.Live.Orchestrator
  • PlacementWatchVixen.Live.Placement.Docker.Tests
  • ProcessPlacementVixen.Live.Placement.Process