https://github.com/seeadoog/routine-local
a ThreadLocal implimetion for go
https://github.com/seeadoog/routine-local
Last synced: 3 months ago
JSON representation
a ThreadLocal implimetion for go
- Host: GitHub
- URL: https://github.com/seeadoog/routine-local
- Owner: seeadoog
- Created: 2019-04-04T09:33:12.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-04T09:37:34.000Z (about 6 years ago)
- Last Synced: 2025-01-28T22:26:39.444Z (4 months ago)
- Language: Go
- Size: 1000 Bytes
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
#### install
```text
go get github.com/skyniu/routine-local
```#### usage
````text
func main() {
for i := 0; i < 100; i++ {
go func(i int) {
Set("key",i)
defer RemoveAll()
fmt.Println("get current routine value:",Get("key"))}(i)
}
time.Sleep(1 * time.Second)}
````