Introduction
A Virtufin worker is a DLL the WorkManager loads, subscribes to a Dapr topic,
and dispatches CloudEvents to. That contract — IWorker, WorkerBase<,> — is
the host contract and ships with the runtime.
Everything above it used to be re-implemented in every devkit and every worker: JSON decoding, content-type decisions, envelope stamping, config resolution, pacing, state saves. This repo is the one implementation of that layer.
The split
| Layer | Package | Owns | Changes when |
|---|---|---|---|
| Host | Virtufin.Worker.Host (in workmanager) |
IWorker, WorkerBase<,>, host codecs, native gateway |
the runtime changes |
| Toolkit | Virtufin.Worker.DevKit (this repo) |
payload codecs, bindings, envelope, config, pacing, state, base workers | workers need new plumbing |
| Domain devkit | Virtufin.{Behavior,MarketData,Indicator,Execution}.DevKit |
codecs and bases of one domain | that domain changes |
| Worker | e.g. Virtufin.Worker.SimpleMovingAverage |
one behaviour and its config | the worker changes |
The rule that keeps the stack honest: the host never depends on the toolkit, and the toolkit never depends on a domain devkit.
What the toolkit is not
- It is not a worker registry or an engine: types are chosen by the package a deployment installs, not by a config string.
- It is not a place for domain semantics: candles, books and trades are market-data; indicators are indicators. The toolkit knows only payload ⇄ CloudEvent.