#once #init #init-once

init-once

Concurrent, non-blocking lazy initialization of values

9 releases (5 breaking)

new 0.6.1 May 2, 2025
0.6.0 Aug 4, 2024
0.5.1 Aug 2, 2024
0.4.3 Aug 1, 2024
0.1.1 Jul 26, 2024

#17 in #once

Download history 429/week @ 2025-01-09 605/week @ 2025-01-16 511/week @ 2025-01-23 813/week @ 2025-01-30 1159/week @ 2025-02-06 1798/week @ 2025-02-13 1635/week @ 2025-02-20 1458/week @ 2025-02-27 2300/week @ 2025-03-06 920/week @ 2025-03-13 891/week @ 2025-03-20 1632/week @ 2025-03-27 857/week @ 2025-04-03 1273/week @ 2025-04-10 803/week @ 2025-04-17 520/week @ 2025-04-24

3,780 downloads per month
Used in 14 crates (via namada_sdk)

MIT license

19KB
377 lines

init_once

The init_once crate provides a mechanic to attempt to read a value without blocking the caller, in case it is being initialized concurrently. Such an abstraction might be useful in cache implementations whose consumers might not want to block on the cache to fill up with data.

Dependencies

~1MB
~19K SLoC