https://github.com/darky/glorage
Gleam thread local storage
https://github.com/darky/glorage
gleam local storage thread
Last synced: 3 months ago
JSON representation
Gleam thread local storage
- Host: GitHub
- URL: https://github.com/darky/glorage
- Owner: darky
- Created: 2024-08-28T16:16:59.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-21T17:34:04.000Z (over 1 year ago)
- Last Synced: 2025-10-30T22:25:25.379Z (7 months ago)
- Topics: gleam, local, storage, thread
- Language: Gleam
- Homepage:
- Size: 11.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# glorage
[](https://hex.pm/packages/glorage)
[](https://hexdocs.pm/glorage/)


Gleam thread local storage
```sh
gleam add glorage
```
```gleam
import glorage
pub fn main() {
use <- glorage.run // init thread local storage
inc(1) // 2
inc(7) // 2, because it's cached inside thread local storage
use n <- glorage.with(inc) // ability to get thread local storage cached value, n is 2
}
fn inc(n) {
use <- glorage.once(inc) // make function cachable inside thread local storage
n + 1
}
```
Further documentation can be found at .
## Development
```sh
gleam run # Run the project
gleam test # Run the tests
```