private void Update(IViewComputationResultModel results) { lock (_lastResultsLock) { CheckDisposed(); Monitor.PulseAll(_lastResultsLock); IEngineResourceReference <IViewCycle> resourceReference = _remoteViewClient.CreateCycleReference(results.ViewCycleId); if (resourceReference == null) { //The engine has overtaken us. We'll get another one soon // -- In theory this can live lock if the view is very fast return; } if (_graphsOutOfDate) { _graphsOutOfDate = false; //NOTE: this is safe because our result message are serialized with our compiled notifications InvokeGraphChanged(); //NOTE: we need to delay this until we have a cycle } var newResults = Pair.Create(resourceReference, results); var previous = Interlocked.Exchange(ref _lastResults, newResults); _haveResults.Set(); if (previous != null) { previous.First.Dispose(); } } }
private static HashSet <Tuple <string, ValueSpecification> > GetAllSpecs(IEngineResourceReference <IViewCycle> cycle) { using (cycle) { return(GetAllSpecs(cycle.Value)); } }
private static HashSet<Tuple<string, ValueSpecification>> GetAllSpecs(IEngineResourceReference<IViewCycle> cycle) { using (cycle) { return GetAllSpecs(cycle.Value); } }