code: func trigger(c context.Context, t tasks.Task, q *datastore.Query) error {
  	tasks := make([]*tq.Task, 0)
  	newPayload := payloadFactory(t)
  	addTask := func(k *datastore.Key) {
  		tasks = append(tasks, &tq.Task{
  			Payload: newPayload(k.StringID()),
  		})
  	}
  	if err := datastore.Run(c, q, addTask); err != nil {
  		return errors.Annotate(err, "failed to fetch keys").Err()
  	}
  	logging.Debugf(c, "scheduling %d tasks", len(tasks))
  	if err := getDispatcher(c).AddTask(c, tasks...); err != nil {
  		return errors.Annotate(err, "failed to schedule tasks").Err()
  	}
  	return nil
  }
docs: // trigger triggers a task queue task for each key returned by the given query.