An open API service indexing awesome lists of open source software.

https://github.com/euskadi31/go-eventemitter

go-eventemitter is the little and lightweight event emitter library for Go.
https://github.com/euskadi31/go-eventemitter

event event-dispatcher event-emitter go golang golang-library library listener

Last synced: about 2 months ago
JSON representation

go-eventemitter is the little and lightweight event emitter library for Go.

Awesome Lists containing this project

README

        

Go Event Emitter [![Last release](https://img.shields.io/github/release/euskadi31/go-eventemitter.svg)](https://github.com/euskadi31/go-eventemitter/releases/latest) [![Documentation](https://godoc.org/github.com/euskadi31/go-eventemitter?status.svg)](https://godoc.org/github.com/euskadi31/go-eventemitter)
================

[![Go Report Card](https://goreportcard.com/badge/github.com/euskadi31/go-eventemitter)](https://goreportcard.com/report/github.com/euskadi31/go-eventemitter)

| Branch | Status | Coverage |
|---------|--------|----------|
| master | [![Build Status](https://img.shields.io/travis/euskadi31/go-eventemitter/master.svg)](https://travis-ci.org/euskadi31/go-eventemitter) | [![Coveralls](https://img.shields.io/coveralls/euskadi31/go-eventemitter/master.svg)](https://coveralls.io/github/euskadi31/go-eventemitter?branch=master) |

go-eventemitter is the little and lightweight event emitter library for Go.

Example
-------

```go
package main

import "github.com/euskadi31/go-eventemitter"

func main() {
emitter := eventemitter.New()

emitter.Subscribe("test", func() {
// code
})

emitter.Subscribe("count", func(i int) {
// code
})

emitter.Dispatch("test")

emitter.Dispatch("count", 42)

emitter.Wait()
}
```

License
-------

go-eventemitter is licensed under [the MIT license](LICENSE.md).