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 } } }
func (m *BaseService) SetUp(delegate IServiceDelegate, timer time.Duration) { m.delegate = delegate m.tickTimer = timer m.messageQueue = message.NewMsgQueue() go m.loop() }