| Filename | Latest commit message | Latest commit date |
|---|---|---|
A pull takes the commit lease only when .commit.lock exists. Without it (no writer has created one yet, or the store was copied without it) the reader loaded with no lease, and a writer committing between its manifest read and its page reads left it with a vanished page or a stale manifest. An unleased pull now keeps its load only if the manifest bytes it read are still current afterwards; a changed manifest, or a named page that is missing or fails its content hash, reloads it, at most five times, and a pull that has not settled by then throws. A retry takes the lease once a writer has created it. Opening still creates nothing. The lease comment no longer claims a missing lock means no writer ever committed, and the store composition contract states the rule. The test deletes the lock from a seeded store and commits from a second cache through an internal seam between the manifest read and the page reads, once replacing the page the reader named and once only adding a key. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> |
||
| .. | ||
| CultCacheFormatterResolverAttribute.cs | ||
| CultCacheMessagePack.cs | ||
| CultDocumentMessagePackSerialization.cs | ||
| CultMessagePackSecurity.cs | ||
| CultRecordRefFormatter.cs | ||
| DirectoryMessagePackBackingStore.cs | ||
| GameCult.Caching.MessagePack.csproj | ||
| README.md | ||
GameCult.Caching.MessagePack
GameCult.Caching.MessagePack provides the canonical CultCache persistence
format for the attribute-first GameCult.Caching stack.
Included Types
SingleFileMessagePackBackingStoreCultDocumentMessagePackSerializationCultDocumentResolverCultRecordRefFormatter<T>
Cult document payloads serialize through MessagePackSerializer with the
options of the document's assembly (CultDocumentMessagePackSerialization.OptionsFor),
after the reflective CultDocumentRegistry has accepted the document shape. The
store snapshot format is written by hand against
MessagePackWriter/MessagePackReader.
What It Does
- stores whole CultCache snapshots in MessagePack
- serializes attributed document payloads as MessagePack
[Key(n)]arrays - keeps explicit
CultRecordRef<T>values compact on disk/wire - preserves the cache/store split where metadata lives outside the domain model
Example Model
using GameCult.Caching;
using MessagePack;
[CultDocument("gamecult.item_data", "gamecult.item_data.v1")]
public sealed class ItemData
{
[Key(0)] [CultName] public string Name = string.Empty;
[Key(1)] public int Value;
}
Typical Usage
using GameCult.Caching;
using GameCult.Caching.MessagePack;
var cache = new CultCache();
var store = new SingleFileMessagePackBackingStore("Data.msgpack");
cache.AddBackingStore(store);
await cache.PullAllBackingStoresAsync();
Notes
- Payload bytes are MessagePack. Store metadata and schema catalogs are also persisted through hand-written MessagePack array layouts in this package.
- The raw CultNet document lane should treat these payload bytes as already blessed, not decode and re-encode them for sport.