This commit is contained in:
Christien Rioux
2023-09-10 17:07:22 -04:00
parent 28b08034f5
commit a5e17a0d65
3 changed files with 53 additions and 0 deletions

View File

@@ -434,6 +434,11 @@ impl RPCProcessor {
//////////////////////////////////////////////////////////////////////
/// Get waiting app call id for debugging purposes
pub fn get_app_call_ids(&self) -> Vec<OperationId> {
self.unlocked_inner.waiting_app_call_table.get_operation_ids()
}
/// Determine if a SignedNodeInfo can be placed into the specified routing domain
fn verify_node_info(
&self,

View File

@@ -30,6 +30,7 @@ where
C: Unpin + Clone,
{
context: C,
timestamp: Timestamp,
eventual: EventualValue<(Option<Id>, T)>,
}
@@ -82,6 +83,7 @@ where
let e = EventualValue::new();
let waiting_op = OperationWaitingOp {
context,
timestamp: get_aligned_timestamp(),
eventual: e.clone(),
};
if inner.waiting_op_table.insert(op_id, waiting_op).is_some() {
@@ -98,6 +100,18 @@ where
}
}
/// Get all waiting operation ids
pub fn get_operation_ids(&self) -> Vec<OperationId> {
let inner = self.inner.lock();
let mut opids: Vec<(OperationId, Timestamp)> = inner
.waiting_op_table
.iter()
.map(|x| (*x.0, x.1.timestamp))
.collect();
opids.sort_by(|a, b| a.1.cmp(&b.1));
opids.into_iter().map(|x| x.0).collect()
}
/// Get operation context
pub fn get_op_context(&self, op_id: OperationId) -> Result<C, RPCError> {
let inner = self.inner.lock();