/// <summary> /// This is called on the main thread from PreviewGraphSyncData /// to generate the list of node id's that will be executed on the next run /// </summary> /// <param name="updatedNodes">The updated nodes.</param> /// <param name="verboseLogging"></param> /// <returns>This method returns the list of all reachable node id's from the given /// updated nodes</returns> internal List <Guid> PreviewGraphSyncData(IEnumerable <NodeModel> updatedNodes, bool verboseLogging) { if (updatedNodes == null) { return(null); } var tempSyncDataManager = syncDataManager.Clone(); var activeNodes = updatedNodes.Where(n => n.State != ElementState.Error); if (activeNodes.Any()) { astBuilder.CompileToAstNodes(activeNodes, CompilationContext.PreviewGraph, verboseLogging); } GraphSyncData graphSyncdata = syncDataManager.GetSyncData(); List <Guid> previewGraphData = this.liveRunnerServices.PreviewGraph(graphSyncdata, verboseLogging); syncDataManager = tempSyncDataManager; lock (previewGraphQueue) { previewGraphQueue.Enqueue(previewGraphData); } return(previewGraphQueue.Dequeue()); }