Beispiel #1
0
func main() {
	fmt.Println("Stress start!")

	service.Register()
	myService.Register()
	center.Use([]string{"Error", "Master", "Harbor", "StressAdd"})

	if center.BaseConfig.Master.IsMaster {
		for {
			prompt()
			var i int
			fmt.Scanf("%d", &i)
			fmt.Println()
			switch i {
			case 1:
				fmt.Println("show")
			case 2:
				center.Send("main", "Master", 0, center.MsgTypeHarbor, &service.RemoteMessage{"StressAdd", center.MsgTypeHarbor, []byte("start")})
			case 3:
				center.Send("main", "Master", 0, center.MsgTypeHarbor, &service.RemoteMessage{"StressAdd", center.MsgTypeHarbor, []byte("stop")})
			default:
				fmt.Println("Unkown operation.")
			}
			fmt.Println()
		}
	} else {
		for {
			time.Sleep(100 * time.Millisecond)
		}
	}

	fmt.Println("Stress exit!")
	glog.Flush()
}
Beispiel #2
0
func main() {
	service.Register()
	gate.RegisterReader(regReader)
	center.Use([]string{"Error", "Gate"})

	glog.Info("Chat start!")

	for {
		time.Sleep(100 * time.Millisecond)
	}

	glog.Info("Chat exit!")
	glog.Flush()
}
Beispiel #3
0
func main() {
	glog.Info("Claw start!")

	service.Register()
	center.Use([]string{"Error", "Master", "Harbor", "Test"})

	center.Send("main", "Test", 1, center.MsgTypeText, "hello, test service")
	center.Send("main", "Error", 1, center.MsgTypeText, "sth. is wrong")

	for {
		time.Sleep(100 * time.Millisecond)
	}

	glog.Info("Claw exit!")
	glog.Flush()
}
Beispiel #4
0
func main() {
	glog.Info("Card start!")

	service.Register()
	myService.Register()

	handler.RegisterHandler()

	center.Use([]string{"Web"})

	for {
		time.Sleep(100 * time.Millisecond)
	}

	glog.Info("Card exit!")
	glog.Flush()
}