Skip to content

lietu/gopusu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PuSu Engine client for Golang

This is a client for the PuSu Engine written in Go. PuSu Engine is a Pub-Sub engine.

More information on the server repository at https://github.com/lietu/pusud.

Get it by running

go get github.com/lietu/gopusu

Usage

Examples are under tests/. Running the tests will require screen or multiple terminal windows.

One terminal window, running a listener;

cd tests
go run listener.go

Running basic test:

cd tests
go run basic.go

Running throughput:

cd tests
go run throughput.go

Short example how to connect to PuSu server:

package main

import "github.com/lietu/gopusu"

func main() {
    pc, _ := gopusu.NewPuSuClient("127.0.0.1", 55000)
    defer pc.Close()
    pc.Authorize("foo")
    pc.Subscribe("channel.1", listener)
    pc.Publish("channel.2", "message")
}

func listener(msg *gopusu.Publish) {
	// ...
}

License

Short version: MIT + New BSD.

Long version: Read the LICENSE.md -file.

Financial support

This project has been made possible thanks to Cocreators and Lietu. You can help us continue our open source work by supporting us on Buy me a coffee.

"Buy Me A Coffee"

About

PuSu Engine client for Golang

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages