FolderSharedCacheStore
ISharedCacheStore in a folder, one file per object.
Nebula · Packages/com.1by3.nebula/Runtime/SharedCache/FolderSharedCacheStore.cspublic sealed class FolderSharedCacheStore : ISharedCacheStoreISharedCacheStore in a folder, one file per object. Used when the process is its own cache: the Editor (including Multiplayer Play Mode), a single-process run, and an orchestrator that keeps its data in files.
A file is named after the hash of its key, so any valid key is a safe file name on every platform and keys that differ only by letter case do not collide. It holds the key, the checksum and the bytes. An object is written to a temporary file in the same folder and then moved into place, so a reader never sees a half-written file and two processes that write the same key at once both succeed. The file's last-write time is the entry's last-read time: nothing else rewrites a finished file.
Constructors
FolderSharedCacheStore
public FolderSharedCacheStore(string folder);Properties
Backend
public string Backend { get; }Folder
public string Folder { get; }The folder the store writes to.
Methods
TryGet
public bool TryGet(string key, out byte[] bytes, out string checksum);Put
public bool Put(string key, byte[] bytes, string checksum);RemoveUnreadSince
public int RemoveUnreadSince(DateTime cutoffUtc);Clear
public int Clear();Count
public long Count();TotalBytes
public long TotalBytes();Dispose
public void Dispose();