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