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); }
/** * {@inheritDoc} */ public void TestIterationStart(LoopIterationEvent iterEvent) { //if (!USE_CACHED_SSL_CONTEXT) { // JsseSSLManager sslMgr = (JsseSSLManager) SSLManager.getInstance(); // sslMgr.resetContext(); // notifySSLContextWasReset(); //} }
/** * {@inheritDoc} */ public void IterationStart(LoopIterationEvent iterEvent) { NotifyTestListeners(); }