func (w *worker) Assign(ctx context.Context, assignments []*api.AssignmentChange) error {
    w.mu.Lock()
    defer w.mu.Unlock()

    if w.closed {