Esempio n. 1
0
        public EvaluatorRuntime(
            ContextManager contextManager,
            IHeartBeatManager heartBeatManager,
            PIDStoreHandler pidStoreHelper,
            EvaluatorExitLogger evaluatorExitLogger)
        {
            using (Logger.LogFunction("EvaluatorRuntime::EvaluatorRuntime"))
            {
                _heartBeatManager    = heartBeatManager;
                _clock               = _heartBeatManager.EvaluatorSettings.RuntimeClock;
                _contextManager      = contextManager;
                _evaluatorId         = _heartBeatManager.EvaluatorSettings.EvalutorId;
                _pidStoreHelper      = pidStoreHelper;
                _evaluatorExitLogger = evaluatorExitLogger;

                var remoteManager = _heartBeatManager.EvaluatorSettings.RemoteManager;

                ReefMessageProtoObserver driverObserver = new ReefMessageProtoObserver();

                // subscribe to driver proto message
                driverObserver.Subscribe(o => OnNext(o.Message));

                // register the driver observer
                _evaluatorControlChannel = remoteManager.RegisterObserver(driverObserver);

                AppDomain.CurrentDomain.UnhandledException += EvaluatorRuntimeUnhandledException;
                DefaultUnhandledExceptionHandler.Unregister();

                // start the heart beat
                _clock.ScheduleAlarm(0, _heartBeatManager);
            }
        }
Esempio n. 2
0
 private Evaluator(
     IClock clock,
     CustomTraceListeners customTraceListeners,
     CustomTraceLevel customTraceLevel,
     EvaluatorExitLogger evaluatorExitLogger)
 {
     _evaluatorExitLogger = evaluatorExitLogger;
     _clock = clock;
     SetCustomTraceListeners(customTraceListeners, customTraceLevel);
 }