func (s *Session) ModuleExecute(context context.T) (err error) {
	log := s.context.Log()
	log.Info("Starting session document processing engine...")

	defer func() {
		if msg := recover(); msg != nil {
			log.Errorf("MessageGatewayService ModuleExecute run panic: %v", msg)
			log.Errorf("%s: %s", msg, debug.Stack())
		}
	}()

	instanceId := s.agentConfig.InstanceID
	resultChan, err := s.processor.Start()
	if err != nil {
		log.Errorf("unable to start session document processor: %s", err)
		return err
	}

	go s.listenReply(resultChan, instanceId)

	log.Info("SSM Agent is trying to setup control channel for Session Manager module.")
	s.controlChannel, err = setupControlChannel(s.context, s.service, s.processor, instanceId)
	if err != nil {
		log.Errorf("Failed to setup control channel, err: %v", err)
		return
	}

	log.Info("Starting receiving message from control channel")

	if err = s.processor.InitialProcessing(false); err != nil {
		log.Errorf("initial processing in EngineProcessor encountered error: %v", err)
		return
	}

	return nil
}
// ModuleExecute starts the scheduling of the session module
ModuleExecute starts the scheduling of the session module
// ModuleExecute starts the scheduling of the session module
func (s *Session) ModuleExecute(context context.T) (err error) {
	log := s.context.Log()
	log.Info("Starting session document processing engine...")
	defer func() {
		if msg := recover(); msg != nil {
			log.Errorf("MessageGatewayService ModuleExecute run panic: %v", msg)
			log.Errorf("%s: %s", msg, debug.Stack())
		}
	}()
	instanceId := s.agentConfig.InstanceID
	resultChan, err := s.processor.Start()
	if err != nil {
		log.Errorf("unable to start session document processor: %s", err)
		return err
	}
	go s.listenReply(resultChan, instanceId)
	log.Info("SSM Agent is trying to setup control channel for Session Manager module.")
	s.controlChannel, err = setupControlChannel(s.context, s.service, s.processor, instanceId)
	if err != nil {
		log.Errorf("Failed to setup control channel, err: %v", err)
		return
	}
	log.Info("Starting receiving message from control channel")
	if err = s.processor.InitialProcessing(false); err != nil {
		log.Errorf("initial processing in EngineProcessor encountered error: %v", err)
		return
	}
	return nil
}
func ( s * Session ) ModuleExecute ( context context . T ) ( err error ) { log := s . context . Log ( ) log . Info ( " " ) defer func ( ) { if msg := recover ( ) ; msg != nil { log . Errorf ( " " , msg ) log . Errorf ( " " , msg , debug . Stack ( ) ) } } ( ) instanceId := s . agentConfig . InstanceID resultChan , err := s . processor . Start ( ) if err != nil { log . Errorf ( " " , err ) return err } go s . listenReply ( resultChan , instanceId ) log . Info ( " " ) s . controlChannel , err = setupControlChannel ( s . context , s . service , s . processor , instanceId ) if err != nil { log . Errorf ( " " , err ) return } log . Info ( " " ) if err = s . processor . InitialProcessing ( false ) ; err != nil { log . Errorf ( " " , err ) return } return nil }
ModuleExecute starts the scheduling of the session module
ModuleExecute starts the scheduling of the session module