// Publish system memory in goroutine with timeout
Publish system memory in goroutine with timeout
// Publish system memory in goroutine with timeout
func (m *memory) Publish(timeout int, qos byte) {
	go func() {
		log.Println("[RUN] Publishing:", qos, m.topic)
		time.Sleep(500 * time.Millisecond)
		for {
			m.PublishOnce(qos)
			time.Sleep(time.Duration(timeout) * time.Millisecond)
		}
	}()
}
func ( m * memory ) Publish ( timeout int , qos byte ) { go func ( ) { log . Println ( " " , qos , m . topic ) time . Sleep ( 500 * time . Millisecond ) for { m . PublishOnce ( qos ) time . Sleep ( time . Duration ( timeout ) * time . Millisecond ) } } ( ) }
Publish system memory in goroutine with timeout
Publish system memory in goroutine with timeout