ysmood / goob

A lightweight buffered event lib

Home Page:https://pkg.go.dev/github.com/ysmood/goob?tab=doc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

Benchmark

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

About

A lightweight buffered event lib

https://pkg.go.dev/github.com/ysmood/goob?tab=doc

License:MIT License


Languages

Language:Go 100.0%