| Filename | Latest commit message | Latest commit date |
|---|---|---|
Every /// line in GameCult.Caching and GameCult.Caching.MessagePack goes; they restated member names. Three blocks that state a rule stay as // comments: MaterializeMissingGlobals runs after hydration so persisted globals win, ExecuteTransactionAsync commits durably before the cache and observers advance, and CommitBatch implementations restore their staged view on failure. Both projects add NoWarn CS1591, since GenerateDocumentationFile is on in src/Directory.Build.props. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> |
||
| .. | ||
| CultCacheMessagePack.cs | ||
| CultDocumentMessagePackSerialization.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>
When a project declares [CultDocument] models, wire in the
GameCult.Caching.MessagePack.Generator analyzer there as well. It emits
assembly-local metadata providers for the cache registry. Cult documents then
serialize through explicit generated slot codecs, while the store snapshot
format is written by hand against MessagePackWriter/MessagePackReader.
What It Does
- stores whole CultCache snapshots in MessagePack
- serializes plain attributed document payloads through explicit generated slot codecs
- 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 generator package now targets attributed document types instead of
DatabaseEntrysubclasses. - The raw CultNet document lane should treat these payload bytes as already blessed, not decode and re-encode them for sport.