Skip to content

In-Memory message broker over websockets using a concurrent, thread-safe pubsub architecture.

Notifications You must be signed in to change notification settings

Manan007224/pbq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pbq

In-Memory message broker over HTTP API using a concurrent, thread-safe pubsub architecture.

Installation

> go get -v github.com/Manan007224/pbq
> cd $GOPATH/src/github.com/Manan007224/pbq
> go build -o pbq
> ./pbq

Pbq by default runs on localhost:3000

Usage

Run server on localhost:3000

./pqb

Run Client

Subscribe

./pbq --client --topic=foo --subscribe 

Publish

echo "A completely arbitrary message" | ./pbq --client --topic=foo --publish

Examples - Client (Library)

Subscriber

c := client.New()
tick := time.NewTicker(time.Second)
for _ = range tick.C {
  if err := c.Publish("foo", []byte(`bar`)); err != nil {
    log.Println(err)
    break
  }
}

Publisher

c := client.New()
ch, err := c.Subscribe("foo")
if err != nil {
  log.Println(err)
  return
}
defer c.Unsubscribe(ch)

for {
  select {
  case e := <-ch:
    log.Println(string(e))
    fmt.Println(string(e))
  }
}

Author

Manan Maniyar: E-mail, @Manan007224

About

In-Memory message broker over websockets using a concurrent, thread-safe pubsub architecture.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages