Skip to content

Layers

graph TD
    R[WorkManager runtime] --> H[Virtufin.Worker.Host]
    C[Virtufin.WorkManager.Client] --> H
    W[Worker package] --> D[Domain devkit]
    D --> B[Virtufin.Behavior.DevKit]
    B --> K[Virtufin.Worker.DevKit]
    B --> C
    K --> H
    R -.loads.-> W

Rules

  1. Host → nothing. The runtime ships the host contract (IWorker, IWorkerContext, WorkerEventRules); it must not know a worker toolkit exists.
  2. Toolkit → the workmanager contracts and the API client only. Virtufin.Worker.DevKit implements IWorker (WorkerCore<,>, and the single-output WorkerBase<,> on it) and owns the codecs and envelope helpers; Virtufin.Behavior.DevKit builds BehaviorWorkerBase on WorkerCore<,> and implements IWorkManagerClient (Virtufin.WorkManager.Client) and IVirtufinApi (Virtufin.Api.Client) locally. Neither references a domain devkit.
  3. Domain devkit → toolkit. One domain's codecs and bases, over BehaviorWorkerBase.
  4. Worker → domain devkit. A worker package is a thin subclass and its config constants.

Type identity

The WorkManager loads each worker into its own AssemblyLoadContext, which resolves dependencies by simple assembly name from the host first. Two consequences follow:

  • The host contract assembly must be the only assembly with its name; the runtime and the worker then share the same types.
  • A renamed host assembly needs a coordinated cutover (see Compatibility).

Why the host was renamed

The WorkerManager loads workers into per-worker AssemblyLoadContexts that resolve by simple assembly name. A host contract named Virtufin.Worker.DevKit and a toolkit of the same name cannot coexist in one host, so:

  • the host contract moved to Virtufin.Worker.Host 0.24.0;
  • the toolkit took the freed name, Virtufin.Worker.DevKit 0.24.0;
  • the old 0.x package was deleted, and old worker packages do not load on 0.24.0.