Skip to content
/ hub Public

A high performance, non-blocking async Publish/Subscribe pattern abstraction.

License

Notifications You must be signed in to change notification settings

bixi/hub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hub

A high performance, non-blocking async Publish/Subscribe pattern abstraction.

Usage

install

$ go get github.com/bixi/hub

example

pubsub := local.NewPubSub()
subject := pubsub.Subject("Hello")

// publish
subject.Publish("Aloha")

// subscribe (usually in another goroutine)
subscriber := subject.Subscribe()
defer subscriber.Close()
for {
    message := <- subscriber.Receive()
    fmt.Printf("%v\n", message)
}

hub types

Local Hub: In-memory implementation of pub/sub, for the purpose of decoupling goroutines, while keeping the choice of switching to message broker middlewares(NATS, Redis, etc.) in the future.

TODO

  • NATS support.
  • Redis support.
  • RPC support.

About

A high performance, non-blocking async Publish/Subscribe pattern abstraction.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages