code: func (u *Supervisor) Update(ctx context.Context, cluster *api.Cluster, service *api.Service, slots []orchestrator.Slot) {
  	u.l.Lock()
  	defer u.l.Unlock()
  
  	id := service.ID
  
  	if update, ok := u.updates[id]; ok {
  		if reflect.DeepEqual(service.Spec, update.newService.Spec) {
  			// There's already an update working towards this goal.
  			return
  		}
  		update.Cancel()
  	}
  
  	update := NewUpdater(u.store, u.restarts, cluster, service)
  	u.updates[id] = update
  	go func() {
  		update.Run(ctx, slots)
  		u.l.Lock()
  		if u.updates[id] == update {
  			delete(u.updates, id)
  		}
  		u.l.Unlock()
  	}()
  }
docs: // Update starts an Update of `slots` belonging to `service` in the background
  // and returns immediately. Each slot contains a group of one or more tasks
  // occupying the same slot (replicated service) or node (global service). There
  // may be more than one task per slot in cases where an update is in progress
  // and the new task was started before the old one was shut down. If an update
  // for that service was already in progress, it will be cancelled before the
  // new one starts.