Interface IConfigurationWriter
- Namespace
- MailFathom.Application.Configuration
- Assembly
- MailFathom.Application.dll
Persists a change to the deployment's settings, having proved the configuration it would produce.
public interface IConfigurationWriter
Remarks
This is the one way MailFathom writes a setting, and the reason it is a port rather than an assignment is that assigning is not what a write is. It resolves where the path is persisted, applies the changes to a candidate document, composes the complete effective configuration the deployment would then read — including the sources that outrank the persisted layer — and runs the same strict binding and the same validators a start runs, against that candidate. Only a candidate that survives all of it is committed, and the commit is refused outright if the document moved on while it was being judged.
What the caller supplies with the changes is the version they were authored against. Two administrators editing at once is the case that decides the contract: the second write has to be refused rather than composed over the first, because the two edits were each written against a document the other did not see and no later reader could recover which of them was meant. A refused caller re-reads the version now in force and decides again.
Nothing here writes a file, an environment variable, a provider dictionary, or an options cache. The change lands in PostgreSQL, which is where the persisted configuration layer is read from, and the layer republishes itself once the commit is durable — so a reload token rises over a version that is already the deployment's, never over one a later failure could take back.
Fields
- MaximumEdits
How many changes one write may carry.
Methods
- WriteAsync(IReadOnlyList<ConfigurationEdit>, long, CancellationToken)
Applies changes to the deployment's persisted configuration.