code: func (w *worker) Assign(ctx context.Context, assignments []*api.AssignmentChange) error {
  	w.mu.Lock()
  	defer w.mu.Unlock()
  
  	if w.closed {
  		return ErrClosed
  	}
  
  	log.G(ctx).WithFields(logrus.Fields{
  		"len(assignments)": len(assignments),
  	}).Debug("(*worker).Assign")
  
  	// Need to update dependencies before tasks
  
  	err := reconcileSecrets(ctx, w, assignments, true)
  	if err != nil {
  		return err
  	}
  
  	err = reconcileConfigs(ctx, w, assignments, true)
  	if err != nil {
  		return err
  	}
  
  	return reconcileTaskState(ctx, w, assignments, true)
  }
docs: // Assign assigns a full set of tasks, configs, and secrets to the worker.
  // Any tasks not previously known will be started. Any tasks that are in the task set
  // and already running will be updated, if possible. Any tasks currently running on
  // the worker outside the task set will be terminated.
  // Anything not in the set of assignments will be removed.