Method ProbeAsync
- Namespace
- IntentSharp.Targets
- Assembly
- IntentSharp.dll
ProbeAsync(TargetContext, CancellationToken)
Returns a cheap token that identifies the target's schema, such as a digest of the schema or a schema version the technology keeps with its data, or null when the target has no such token. With a token, the runtime describes the target again only when the token changes; without one, before every operation.
ValueTask<string?> ProbeAsync(TargetContext context, CancellationToken ct = default)
Parameters
contextTargetContextThe operation's context; its Description is null.
ctCancellationTokenCancels the call.
Returns
- ValueTask<string>
The token, or null when the target has none.
Remarks
The token is the target's whole fingerprint: the runtime records it in the change ledger under Name and compares it with the token an earlier process recorded, so a schema changed while the application was stopped is found at the next start. The token must therefore be comparable across processes and stores: the same token must mean the same schema (everything the description reports), whichever process computed it and over whichever store, and a different schema must give a different token. A digest of the schema always qualifies. A schema version the technology keeps with its data qualifies only while Name reaches that one store, since another store can hold a different schema under the same version.
A counter kept in memory, the time of the last write, or any other value that starts over in a new process or changes when only the data changes is not such a token: it raises a schema change on a write that changed no schema, and misses one when two schemas reach the same value. A target without such a token returns null, and the runtime fingerprints its description instead.