Commit graph

15 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
0d61b12561 fix snippet 2024-11-30 10:57:42 -06:00
maddalax
baf10419f7 fix examples link 2024-11-25 10:23:12 -06:00
maddalax
9b69b25d0b minimal htmgo doc 2024-11-21 07:45:34 -06:00
maddalax
7d04d8861f add windows instructions 2024-11-01 07:29:15 -05:00
maddalax
2c4ac8b286
gen code for assets (#68)
* gen code for assets

* fix

* test
2024-11-01 06:10:35 -05:00
maddalax
4c6187e18d add docs for eval commands 2024-11-01 05:08:36 -05:00
maddalax
3cd7577b06 css fixes 2024-10-30 14:44:02 -05:00
maddalax
e6223a36b7 remove myapp 2024-10-30 14:32:27 -05:00
maddalax
60a37b65d6 change version 2024-10-30 14:17:35 -05:00
maddalax
5feb271aed fix 2024-10-30 14:14:12 -05:00
maddalax
129c230c72 fix link 2024-10-30 13:50:52 -05:00
maddalax
1ce5f37fc4 set title 2024-10-30 13:39:07 -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