summaryrefslogblamecommitdiffstats
path: root/vendor/github.com/mrexodia/wray/examples/client.go
blob: 50edf446141a7aa17f629733afac4796fff60bda (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17















                                                                          
package main

import "github.com/pythonandchips/wray"
import "fmt"

func main() {
	wray.RegisterTransports([]wray.Transport{&wray.HttpTransport{}})
	client := wray.NewFayeClient("http://localhost:5000/faye")

	fmt.Println("subscribing")
	client.Subscribe("/foo", false, func(message wray.Message) {
		fmt.Println("-------------------------------------------")
		fmt.Println(message.Data)
	})

	client.Listen()
}