Compze.Teventive.MemoryImageStateStore.MemoryPack
0.1.0-alpha
dotnet add package Compze.Teventive.MemoryImageStateStore.MemoryPack --version 0.1.0-alpha
NuGet\Install-Package Compze.Teventive.MemoryImageStateStore.MemoryPack -Version 0.1.0-alpha
<PackageReference Include="Compze.Teventive.MemoryImageStateStore.MemoryPack" Version="0.1.0-alpha" />
<PackageVersion Include="Compze.Teventive.MemoryImageStateStore.MemoryPack" Version="0.1.0-alpha" />
<PackageReference Include="Compze.Teventive.MemoryImageStateStore.MemoryPack" />
paket add Compze.Teventive.MemoryImageStateStore.MemoryPack --version 0.1.0-alpha
#r "nuget: Compze.Teventive.MemoryImageStateStore.MemoryPack, 0.1.0-alpha"
#:package Compze.Teventive.MemoryImageStateStore.MemoryPack@0.1.0-alpha
#addin nuget:?package=Compze.Teventive.MemoryImageStateStore.MemoryPack&version=0.1.0-alpha&prerelease
#tool nuget:?package=Compze.Teventive.MemoryImageStateStore.MemoryPack&version=0.1.0-alpha&prerelease
Compze.Teventive.MemoryImageStateStore.MemoryPack
A MemoryPack cache for the JSON files of Compze's memory image state store, so that a memory image state store kept in files starts fast.
What is Compze?
Compze is a .NET framework for building expressive domains through Teventive programming and Typermedia APIs. Learn more
What's in this package?
StartingFromAMemoryPackCache()— declared with a store's files,files.StartingFromAMemoryPackCache().FolderOf<VocabNote>("vocab"), it has the store start from a cache of the snapshots its files held at an earlier start. The store then reads only the files that are new, or whose length or last write time changed since, and drops those that are gone.- A cache for each class, kept in the store's own folder and written whole after a start that read any file or found one gone.
- A changed snapshot type is caught: the cache records a fingerprint of the snapshot type's fields, and a cache written for another shape of the type is not used.
Each class's snapshot type must be one MemoryPack serializes, such as a [MemoryPackable] class.
Related packages
| Package | Description |
|---|---|
| Compze.Teventive.MemoryImageStateStore | The memory image state store, and its JSON files |
License
Apache-2.0
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Compze.Contracts (>= 0.7.2)
- Compze.Teventive.MemoryImageStateStore (>= 0.1.0-alpha)
- MemoryPack (>= 1.21.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-alpha | 77 | 11/19/2026 |
- **A MemoryPack cache for a memory image state store kept in JSON files,** declared with `files.StartingFromAMemoryPackCache().FolderOf<TTaggregate>(folder)`, so the store starts without reading every file.
- A cache file for each class, in the store's own folder, holds each file's path, length and last write time with the snapshot it held. At the next start, a file whose length and last write time are unchanged takes its snapshot from the cache. A new or changed file is read, and a gone one is dropped.
- The cache is written after a start that read any file or found one gone, whole, under a temporary name and renamed. Commits don't write it: the files a commit wrote are read at the next start.
- A cache written for another shape of a class's snapshot type isn't used: it records a fingerprint of the type's instance fields, and of the types reachable through them, and the start reads every file of the class and writes the cache anew. MemoryPack reads by position, so such a cache could otherwise read back wrong values without failing.
- A cache that can't be read fails the start, naming it. Deleting it gives a start that reads every file.
- Each class's snapshot type must be one MemoryPack serializes, such as a `[MemoryPackable]` class: asserted where the store is composed.