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