https://github.com/ysmood/goob
A lightweight buffered event lib
https://github.com/ysmood/goob
Last synced: 6 months ago
JSON representation
A lightweight buffered event lib
- Host: GitHub
- URL: https://github.com/ysmood/goob
- Owner: ysmood
- License: mit
- Created: 2020-06-06T20:17:45.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-04-09T04:52:52.000Z (almost 4 years ago)
- Last Synced: 2025-05-12T13:56:16.274Z (8 months ago)
- Language: Go
- Homepage: https://pkg.go.dev/github.com/ysmood/goob?tab=doc
- Size: 39.1 KB
- Stars: 59
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Overview
A lightweight observable lib. Go channel doesn't support unlimited buffer size,
it's a pain to decide what size to use, this lib will handle it dynamically.
- unlimited buffer size
- one publisher to multiple subscribers
- thread-safe
- subscribers never block each other
- stable event order
## Examples
See [examples_test.go](examples_test.go).
## Benchmark
```txt
goos: darwin
goarch: amd64
pkg: github.com/ysmood/goob
cpu: Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
BenchmarkPublish-12 7493547 143.9 ns/op 86 B/op 0 allocs/op
BenchmarkConsume-12 4258910 275.5 ns/op 0 B/op 0 allocs/op
```