code: func (ctl *taskController) EmitTrigger(ctx context.Context, trigger *internal.Trigger) {
  	ctl.DebugLog("Emitting a trigger %s", trigger.Id)
  	trigger.JobId = ctl.JobID()
  	trigger.InvocationId = ctl.InvocationID()
  
  	// See docs for internal.Trigger proto. Tuple (created, order_in_batch) used
  	// for casual ordering of triggers emitted by an invocation. Callers of
  	// EmitTrigger are free to override this by supplying their own timestamp. In
  	// such case they also should provide order_in_batch. Otherwise we build the
  	// tuple for them based on the order of EmitTrigger calls.
  	if trigger.Created == nil {
  		trigger.Created = google.NewTimestamp(clock.Now(ctx))
  		trigger.OrderInBatch = ctl.triggerIndex
  	}
  
  	ctl.triggers = append(ctl.triggers, trigger)
  	ctl.triggerIndex++ // note: this is NOT reset in Save, unlike ctl.triggers.
  }
docs: // EmitTrigger is part of task.Controller interface.