Skip to content

Layers

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

Rules

  1. Host → nothing. The runtime ships the host contract; it must not know a worker toolkit exists.
  2. Toolkit → host only. The toolkit may derive from WorkerBase<,> and use ICloudEventCodec<,>; it must not reference a domain devkit.
  3. Domain devkit → toolkit + host. One domain's codecs and bases.
  4. Worker → domain devkit + toolkit. 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).