https://github.com/jochasinga/tooth
Experimental pub-sub style abstraction of channel operations in Go.
https://github.com/jochasinga/tooth
Last synced: about 1 year ago
JSON representation
Experimental pub-sub style abstraction of channel operations in Go.
- Host: GitHub
- URL: https://github.com/jochasinga/tooth
- Owner: jochasinga
- License: other
- Created: 2016-07-26T17:32:13.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-10-13T13:15:55.000Z (over 9 years ago)
- Last Synced: 2025-02-02T09:26:49.807Z (over 1 year ago)
- Language: Go
- Size: 4.88 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tooth
**tooth** abstracts channel operations in Go by means of a pubsub-like methods.
## Usage
`Tooth` instance is used to exchange data within the code.
## Examples
```go
frodo := tooth.New("frodo")
sam := tooth.New("sam")
gollum := tooth.New("gollum")
sam.Subscribe(frodo)
frodo.Subscribe(gollum)
sam.Subscribe(gollum)
frodo.Publish("I'm so tired")
gollum.Publish("My preciousssss")
msg1 := sam.FetchAll() // [I'm so tired My preciousssss]
msg2 := frodo.Fetch(gollum) // My preciousssss
```
Right now it's limited to only `string` but I'm working on it.