InMemoryPropertyStore
In-memory implementation of PropertyStore.
This store keeps feature properties in a mutable map backed by process memory. It is intended for tests, local development, or lightweight runtime configurations where persistence across application restarts is not required.
Concurrency and thread safety
All operations on the underlying map are guarded by a Mutex and executed via the withReentrantLock utility, which provides coroutine-friendly, reentrant mutual exclusion. This ensures that:
concurrent readers and writers are serialized, preventing data races; and
a coroutine that already holds the lock can safely call other methods on this store without deadlocking.
Despite being thread-safe within a single process, this implementation does not provide any cross-process or distributed consistency guarantees.
Functions
Returns the number of properties in the store.
Creates a new property or updates it if it already exists (upsert operation).
Retrieves a property by name, throwing an exception if not found.
Retrieves a property's value directly, without the Property wrapper.
Retrieves a property's value, or returns a default if not found.
Lists all property ids in the store.
Removes a property from the store by id.
Adds a new property to the store.