Caching: public ReadStoreSnapshot and WriteRecord replace Mesh's InternalsVisibleTo reach
SingleFileBackingStore gains the cacheless single-file read and write CultMesh used through internals; CultMeshSingleFileDocuments is now a caller of the public API only, and the GameCult.Mesh InternalsVisibleTo grant (with the duplicate Tests/MessagePack grants) is deleted. Owns finding mesh-ivt-moved-not-removed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
5baa02fa54
commit
26bf0986d0
5 changed files with 157 additions and 32 deletions
|
|
@ -16,6 +16,23 @@ var committed = outside.Commit(batch =>
|
|||
});
|
||||
if (!committed)
|
||||
return 1;
|
||||
|
||||
// A store file is written and read without a cache through the two public members: this project has no InternalsVisibleTo, so
|
||||
// building it pins that ReadStoreSnapshot and WriteRecord are public API.
|
||||
var storePath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "consumer-build-" + System.Guid.NewGuid().ToString("N") + ".cc");
|
||||
try
|
||||
{
|
||||
var entry = new CultSchemaCatalogEntry { SchemaId = "outside.written", SchemaName = "outside.written" };
|
||||
var store = new GameCult.Caching.MessagePack.SingleFileMessagePackBackingStore(storePath);
|
||||
store.WriteRecord(new CultPersistedRecord { Key = "r", SchemaId = entry.SchemaId, StoredAt = "t", Payload = new byte[] { 0x90 } }, entry);
|
||||
var snapshot = store.ReadStoreSnapshot();
|
||||
if (snapshot == null || snapshot.Records.Length != 1 || snapshot.Records[0].Key != "r")
|
||||
return 1;
|
||||
}
|
||||
finally
|
||||
{
|
||||
System.IO.File.Delete(storePath);
|
||||
}
|
||||
return 0;
|
||||
|
||||
// Lists one record under an id no type claims, at version "v1", and commits only when the conditions hold over it.
|
||||
|
|
|
|||
Loading…
Reference in a new issue