Skip to content

Add JsonSnapshotStateStore for durable state persistence#4

Merged
Clifftech123 merged 1 commit into
mainfrom
develop
May 21, 2026
Merged

Add JsonSnapshotStateStore for durable state persistence#4
Clifftech123 merged 1 commit into
mainfrom
develop

Conversation

@Clifftech123
Copy link
Copy Markdown
Owner

Introduce JsonSnapshotStateStore implementing IStateStore to persist state to a JSON file on disk. The class uses an in-memory ConcurrentDictionary for fast access and ensures state survives process restarts by saving changes to a snapshot file. The default file path is %TEMP%/azlocal/state.json, configurable via AzLocal:SnapshotPath.

Implemented methods include GetAsync, SetAsync, DeleteAsync, ListAsync, and ExistsAsync, with thread-safe file writes ensured via SemaphoreSlim. Added private helpers for loading and saving state. Includes XML documentation for clarity.

Introduce JsonSnapshotStateStore implementing IStateStore to
persist state to a JSON file on disk. The class uses an in-memory
ConcurrentDictionary for fast access and ensures state survives
process restarts by saving changes to a snapshot file. The default
file path is %TEMP%/azlocal/state.json, configurable via
AzLocal:SnapshotPath.

Implemented methods include GetAsync, SetAsync, DeleteAsync,
ListAsync, and ExistsAsync, with thread-safe file writes ensured
via SemaphoreSlim. Added private helpers for loading and saving
state. Includes XML documentation for clarity.
@Clifftech123 Clifftech123 merged commit 665fe60 into main May 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant