https://github.com/sauerbraten/pubsub
A Go package implementing a topic-based publish-subscribe system using channels.
https://github.com/sauerbraten/pubsub
channels go message-bus publish-subscribe pubsub
Last synced: 22 days ago
JSON representation
A Go package implementing a topic-based publish-subscribe system using channels.
- Host: GitHub
- URL: https://github.com/sauerbraten/pubsub
- Owner: sauerbraten
- License: mit
- Created: 2017-10-20T17:32:20.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-04-28T14:30:37.000Z (about 3 years ago)
- Last Synced: 2024-11-06T07:39:00.892Z (6 months ago)
- Topics: channels, go, message-bus, publish-subscribe, pubsub
- Language: Go
- Homepage:
- Size: 6.84 KB
- Stars: 19
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pubsub
A Go package implementing a topic-based publish-subscribe system using channels.
## Usage
Get the package:
$ go get github.com/sauerbraten/pubsub
Import the package:
```go
import (
"github.com/sauerbraten/pubsub"
)
```Subscribers receive updates on channels provided to them when they subscribe to a topic. Topics are automatically created when you subscribe to them and they do not exist yet. In that case, a Publisher type is returned as well, providing methods to publish updates on the new topic. Topics are removed when a subscriber unsubscribes from it and there are no other subscribers left. Publishers include a stop channel from which reading only succeeds after the topic was removed.
## Documentation
[Full documentation at godoc.org.](https://godoc.org/github.com/sauerbraten/pubsub)
## Example
See [example/main.go](./example/main.go).