Unverified Commit 8a000b1c authored by Hong Minhee's avatar Hong Minhee
Browse files

Add optional CAS operation to KvStore

This commit introduces an optional `cas` (compare-and-swap) method to
the `KvStore` interface, enabling atomic updates. This is useful for
implementing optimistic locking and preventing lost updates in concurrent
environments.

The following implementations have been updated:
- `MemoryKvStore`: Implemented `cas` method.
- `DenoKvStore`: Implemented `cas` method using Deno KV's atomic operations.
- `WorkersKvStore`: Noted that Cloudflare Workers KV does not support atomic CAS
  operations.

Test cases have been added for the `MemoryKvStore` and `DenoKvStore`
implementations.
parent c4c4ec3c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment