Esempio n. 1
0
func main() {
	goRiffle.Info("Server starting")
	goRiffle.SetLoggingLevel(3)

	a := goRiffle.NewDomain("xs.damouse.alpha")
	a.Join()

	e := a.Subscribe("sub", func() {
		goRiffle.Info("Pub received!")
	})

	if e != nil {
		goRiffle.Info("Unable to subscribe: ", e.Error())
	}

	e = a.Register("reg", func() {
		goRiffle.Info("Call received!")
	})

	if e != nil {
		goRiffle.Info("Unable to subscribe: ", e.Error())
	}

	// Run the client until Leave is called
	a.Run()
}
Esempio n. 2
0
func main() {
	fmt.Println("Client starting")

	a := goRiffle.NewDomain("xs.damouse.beta")
	a.Join()

	a.Call("xs.damouse/reg", true, "Hello!")
	a.Publish("xs.damouse/sub", 3)

	a.Run()
}