Пример #1
0
        public void Start()
        {
            if (Running)
            {
                return;
            }

            CancellationSource = new CancellationTokenSource();
            RunTask            = Task.Factory.StartNew(() =>
            {
                while (!CancellationSource.IsCancellationRequested)
                {
                    try
                    {
                        LoopIterationEvent?.Invoke(CancellationSource.Token);
                    }
                    catch (OperationCanceledException e)
                    {
                        if (e.CancellationToken != CancellationSource.Token)
                        {
                            throw;
                        }
                        Console.WriteLine("Received OperationCancelledException from within the run loop.");
                    }
                }
            }, CancellationSource.Token, TaskCreationOptions.LongRunning, TaskScheduler.Default);
        }
Пример #2
0
 /**
  * {@inheritDoc}
  */
 public void TestIterationStart(LoopIterationEvent iterEvent)
 {
     //if (!USE_CACHED_SSL_CONTEXT) {
     //    JsseSSLManager sslMgr = (JsseSSLManager) SSLManager.getInstance();
     //    sslMgr.resetContext();
     //    notifySSLContextWasReset();
     //}
 }
Пример #3
0
 /**
  * {@inheritDoc}
  */
 public void IterationStart(LoopIterationEvent iterEvent)
 {
     NotifyTestListeners();
 }