https://github.com/seeadoog/infchan
go chan with infinity capacity , never block on sending
https://github.com/seeadoog/infchan
Last synced: 3 months ago
JSON representation
go chan with infinity capacity , never block on sending
- Host: GitHub
- URL: https://github.com/seeadoog/infchan
- Owner: seeadoog
- Created: 2022-06-06T08:07:05.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-01-28T03:33:16.000Z (over 1 year ago)
- Last Synced: 2025-01-28T22:26:36.063Z (5 months ago)
- Language: Go
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## InfChan
InfChan is a go chan with infinity capacity. Put elem to Chan will never block.### example
````c := NewChan[int](1)
for i := 0; i < 10; i++ {
c.Put(i)
}
c.Close()
for {data, ok := <-c.Get()
fmt.Println(data, ok)
if !ok {
break
}
}````