pub struct ApprovalRegistry { /* private fields */ }Expand description
The live pending requests held by one service’s open runtime connections.
A request enters when the connection surfaces it and leaves when it is answered or the connection goes away. Nothing here survives the process: a live request only exists while the turn that raised it is blocked.
Implementations§
Source§impl ApprovalRegistry
impl ApprovalRegistry
Sourcepub fn observe(
&mut self,
connection: &str,
harness: &HarnessId,
runtime_id: &str,
event: &HarnessEvent,
now_ms: i64,
) -> bool
pub fn observe( &mut self, connection: &str, harness: &HarnessId, runtime_id: &str, event: &HarnessEvent, now_ms: i64, ) -> bool
Record one runtime event if it is a permission/approval request.
Returns true when the event was recognized and is now listable. A
repeat of a request already held is not duplicated.
Sourcepub fn answered(&mut self, connection: &str, request_id: &Value) -> bool
pub fn answered(&mut self, connection: &str, request_id: &Value) -> bool
Drop one request because it was answered.
Sourcepub fn forget(&mut self, connection: &str)
pub fn forget(&mut self, connection: &str)
Drop everything held for a connection that closed or failed.
Sourcepub fn resolution(
&self,
row_id: &str,
choice: &ApprovalChoice,
) -> Result<ApprovalResolution, ApprovalResolveError>
pub fn resolution( &self, row_id: &str, choice: &ApprovalChoice, ) -> Result<ApprovalResolution, ApprovalResolveError>
Plan the answer to one listed row (ORCH-20).
Looks the row up by the same id Self::rows published, translates
the caller’s choice through the door that raised it, and returns what
harness.v1.runtimes.respond needs. Nothing is sent and nothing is
forgotten here: the service performs the answer on the existing
respond path, which is also what drops the row.
Sourcepub fn rows(&self, now_ms: i64) -> Vec<ApprovalRow>
pub fn rows(&self, now_ms: i64) -> Vec<ApprovalRow>
Every outstanding request as a row, aged against now_ms.