code: func (s *Simulator) handleRequest(r task.Request) {
  	dur := s.OnRequest(s, r)
  	if dur <= 0 {
  		panic("the invocation duration should be positive")
  	}
  
  	inv := &SimulatedInvocation{
  		Request:  r,
  		Created:  s.Now.Sub(s.Epoch),
  		Duration: dur,
  		Running:  true,
  	}
  	s.Invocations = append(s.Invocations, inv)
  
  	s.nextInvID++
  	id := s.nextInvID
  	if s.invIDs == nil {
  		s.invIDs = map[int64]*SimulatedInvocation{}
  	}
  	s.invIDs[id] = inv
  
  	s.scheduleEvent(event{
  		eta: s.Now.Add(inv.Duration),
  		cb: func() {
  			// On invocation completion, kick it from the active invocations set and
  			// rerun the triggering policy function to decide what to do next.
  			inv.Running = false
  			delete(s.invIDs, id)
  			s.triage()
  		},
  	})
  }
docs: // handleRequest is called for each invocation request created by the policy.
  //
  // It adds new SimulatedInvocation to Invocations list.