Cosmos Nicolaou | 6c6fa11 | 2014-08-19 13:22:33 -0700 | [diff] [blame] | 1 | // +build ignore |
| 2 | |
| 3 | package main |
| 4 | |
| 5 | import ( |
| 6 | "fmt" |
| 7 | |
| 8 | "veyron2/config" |
| 9 | "veyron2/rt" |
| 10 | |
| 11 | "veyron/profiles/net" |
| 12 | ) |
| 13 | |
| 14 | func main() { |
| 15 | r := rt.Init() |
| 16 | defer r.Cleanup() |
| 17 | |
| 18 | ch := make(chan config.Setting, 10) |
| 19 | p := r.Publisher() |
| 20 | settings, err := p.ForkStream(net.StreamName, ch) |
| 21 | if err != nil { |
| 22 | r.Logger().Infof("failed to fork stream: %s", err) |
| 23 | } |
| 24 | for _, setting := range settings.Latest { |
| 25 | fmt.Println("Setting: ", setting) |
| 26 | } |
| 27 | for setting := range ch { |
| 28 | fmt.Println("Setting: ", setting) |
| 29 | } |
| 30 | } |