@@ -84,7 +84,7 @@ pub enum ExecutionStateErrors {
84
84
CellExecutionUnexpectedFailure ( ExecutionNodeId , String ) ,
85
85
#[ error( "unknown execution state error" ) ]
86
86
Unknown ( String ) ,
87
- #[ error( "anyhow error " ) ]
87
+ #[ error( "Anyhow Error: {0} " ) ]
88
88
AnyhowError ( String ) ,
89
89
}
90
90
@@ -131,7 +131,7 @@ impl Debug for ExecutionStateEvaluation {
131
131
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
132
132
match self {
133
133
ExecutionStateEvaluation :: Complete ( ref state) => f. debug_tuple ( "Complete" ) . field ( state) . finish ( ) ,
134
- ExecutionStateEvaluation :: Executing ( .. ) => f. debug_tuple ( "Executing" ) . field ( & format ! ( "Future state evaluating" ) ) . finish ( ) ,
134
+ ExecutionStateEvaluation :: Executing ( ref state ) => f. debug_tuple ( "Executing" ) . field ( state) . finish ( ) ,
135
135
ExecutionStateEvaluation :: Error ( _) => unreachable ! ( "Cannot get state from a future state" ) ,
136
136
ExecutionStateEvaluation :: EvalFailure ( _) => unreachable ! ( "Cannot get state from a future state" ) ,
137
137
}
@@ -187,6 +187,9 @@ pub struct ExecutionState {
187
187
/// Map of operation_id -> OperationNode definition
188
188
pub operation_by_id : ImHashMap < OperationId , Arc < Mutex < OperationNode > > > ,
189
189
190
+ /// Map of operation_id -> Cell definition
191
+ pub cells_by_id : ImHashMap < OperationId , CellTypes > ,
192
+
190
193
/// This is a mapping of function names to operation ids. Function calls are dispatched to the associated
191
194
/// OperationId that they are initialized by. When a function is invoked, it is dispatched to the operation
192
195
/// node that initialized it where we re-use that OperationNode's runtime in order to invoke the function.
@@ -225,8 +228,8 @@ fn render_map_as_table(exec_state: &ExecutionState) -> String {
225
228
|---|---|" ) ) ;
226
229
for key in exec_state. state . keys ( ) {
227
230
if let Some ( val) = exec_state. state_get ( key) {
228
- table. push_str ( & format ! ( indoc!( r"
229
- | {} | {:?} |" ) , key , val ) ) ;
231
+ table. push_str ( & format ! ( indoc!( r"| {} | {:?} |" ) , key , val ) ) ;
232
+ table . push_str ( " \n " ) ;
230
233
}
231
234
}
232
235
table. push_str ( "\n " ) ;
@@ -255,7 +258,7 @@ async fn pause_future_with_oneshot(execution_state_evaluation: ExecutionStateEva
255
258
}
256
259
// let recv = oneshot_receiver.await.expect("Failed to receive oneshot signal");
257
260
}
258
- println ! ( "Continuing from oneshot signal " ) ;
261
+ println ! ( "============= should resume ============= " ) ;
259
262
RkyvSerializedValue :: Null
260
263
} ;
261
264
sender. send ( ( execution_state_evaluation, Some ( oneshot_sender) ) ) . await . expect ( "Failed to send oneshot signal to the graph receiver" ) ;
@@ -281,6 +284,7 @@ impl Default for ExecutionState {
281
284
fresh_values : Default :: default ( ) ,
282
285
operation_name_to_id : Default :: default ( ) ,
283
286
operation_by_id : Default :: default ( ) ,
287
+ cells_by_id : Default :: default ( ) ,
284
288
function_name_to_metadata : Default :: default ( ) ,
285
289
has_been_set : Default :: default ( ) ,
286
290
dependency_map : Default :: default ( ) ,
@@ -537,7 +541,7 @@ impl ExecutionState {
537
541
} )
538
542
} ;
539
543
operation_node. id = op_id;
540
-
544
+ s . cells_by_id . insert ( op_id , operation_node . cell . clone ( ) ) ;
541
545
s. operation_by_id . insert ( op_id, Arc :: new ( Mutex :: new ( operation_node) ) ) ;
542
546
s. update_callable_functions ( ) ;
543
547
s. exec_queue . push_back ( op_id) ;
@@ -836,7 +840,7 @@ impl ExecutionState {
836
840
let operation_count = self . operation_by_id . keys ( ) . count ( ) ;
837
841
let mut count_loops = 0 ;
838
842
loop {
839
- println ! ( "looping {:?}" , self . exec_queue) ;
843
+ println ! ( "looping {:?} {:?} " , self . exec_queue, count_loops ) ;
840
844
count_loops += 1 ;
841
845
if count_loops >= operation_count * 2 {
842
846
return Err ( Error :: msg ( "Looped through all operations without detecting an execution" ) ) ;
0 commit comments