Skip to content

JonasHiltl/emit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Emit

Minimal event emitter using channels.

  • Type Safe: built on generics
  • Batching: timeout and size

Installation

go get github.com/jonashiltl/emit

Usage

e := new(emit.Emitter) // or &emit.Emmiter{}

emit.On(e, func(batch []MyEvent) {
    fmt.Println(batch)
}, WithBatchSize(10), WithTimeout(10*time.Second))

emit.Emit(e, MyEvent{})

Inspired by mint

About

Minimal generic event emitter

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages