code: func (w *DefaultWorker) startClosing(fn func()) {
  	w.smu.Lock()
  	defer w.smu.Unlock()
  	if w.state != open {
  		return
  	}
  
  	w.lifecycle.StopListening()
  	w.heart.Close()
  	w.janitorRunner.Close()
  
  	fn()
  
  	w.lifecycle.Await()
  
  	w.state = closed
  }
docs: // Starts closing the worker if it was not already closed. Invokes the passed
  // function to help in the teardown, and blocks until all tasks are done.