Commit graph

4 commits

Author SHA1 Message Date
franchb
cfcfe7cb21
Use GetOrCompute for atomic cache access
The commit introduces an atomic GetOrCompute method to the cache interface and refactors all cache implementations to use it. This prevents race conditions and duplicate computations when multiple goroutines request the same uncached key simultaneously.

The changes eliminate a time-of-check to time-of-use race condition in the original caching implementation, where separate Get/Set operations could lead to duplicate renders under high concurrency.

With GetOrCompute, the entire check-compute-store operation happens atomically while holding the lock, ensuring only one goroutine computes a value for any given key.

The API change is backwards compatible as the framework handles the GetOrCompute logic internally. Existing applications will automatically benefit from the
2025-07-03 17:46:09 +03:00
franchb
6773c96cbf
Add custom cache stores docs and navigation
Signed-off-by: franchb <hello@franchb.com>
2025-06-27 16:25:05 +03:00
maddalax
4c6187e18d add docs for eval commands 2024-11-01 05:08:36 -05:00
maddalax
35877a1b2e
New Docs (#63)
* scripting enhancements

* tests

* cleanup / tests

* new docs wip

* add more docs

* more updates

* add caching docs

* add sse docs

* more docs

* sidebar, and fix navigation blocks

* remove old docs

* set proper meta

* fixes
2024-10-30 13:27:42 -05:00