@@ -51,7 +51,7 @@ pub enum NodeGraphUpdate {
51
51
pub struct NodeGraphExecutor {
52
52
runtime_io : NodeRuntimeIO ,
53
53
current_execution_id : u64 ,
54
- futures : HashMap < u64 , ExecutionContext > ,
54
+ futures : VecDeque < ( u64 , ExecutionContext ) > ,
55
55
node_graph_hash : u64 ,
56
56
previous_node_to_inspect : Option < NodeId > ,
57
57
}
@@ -157,7 +157,7 @@ impl NodeGraphExecutor {
157
157
// Execute the node graph
158
158
let execution_id = self . queue_execution ( render_config) ;
159
159
160
- self . futures . insert ( execution_id, ExecutionContext { export_config : None , document_id } ) ;
160
+ self . futures . push_back ( ( execution_id, ExecutionContext { export_config : None , document_id } ) ) ;
161
161
162
162
Ok ( DeferMessage :: SetGraphSubmissionIndex { execution_id } . into ( ) )
163
163
}
@@ -213,7 +213,7 @@ impl NodeGraphExecutor {
213
213
export_config : Some ( export_config) ,
214
214
document_id,
215
215
} ;
216
- self . futures . insert ( execution_id, execution_context) ;
216
+ self . futures . push_back ( ( execution_id, execution_context) ) ;
217
217
218
218
Ok ( ( ) )
219
219
}
@@ -273,7 +273,19 @@ impl NodeGraphExecutor {
273
273
responses. extend ( existing_responses. into_iter ( ) . map ( Into :: into) ) ;
274
274
document. network_interface . update_vector_modify ( vector_modify) ;
275
275
276
- let execution_context = self . futures . remove ( & execution_id) . ok_or_else ( || "Invalid generation ID" . to_string ( ) ) ?;
276
+ while let Some ( & ( fid, _) ) = self . futures . front ( ) {
277
+ if fid < execution_id {
278
+ self . futures . pop_front ( ) ;
279
+ } else {
280
+ break ;
281
+ }
282
+ }
283
+
284
+ let Some ( ( fid, execution_context) ) = self . futures . pop_front ( ) else {
285
+ panic ! ( "InvalidGenerationId" )
286
+ } ;
287
+ assert_eq ! ( fid, execution_id, "Missmatch in execution id" ) ;
288
+
277
289
if let Some ( export_config) = execution_context. export_config {
278
290
// Special handling for exporting the artwork
279
291
self . export ( node_graph_output, export_config, responses) ?;
0 commit comments