示例#1
0
func MsgQueue() {
	msgQueue := message.NewMsgQueue()

	go PushQueue(1, msgQueue)
	go PushQueue(100, msgQueue)
	go ReadQueue(msgQueue)

	i := 0
	for _ = range time.Tick(1e9) {
		i += 1
		if i > 2 {
			break
		}
	}
}
示例#2
0
func (m *BaseService) SetUp(delegate IServiceDelegate, timer time.Duration) {
	m.delegate = delegate
	m.tickTimer = timer
	m.messageQueue = message.NewMsgQueue()
	go m.loop()
}