pub struct PromiseTable { /* private fields */ }
Expand description
Table for tracking pending promises and their resolution
Implementations§
Source§impl PromiseTable
impl PromiseTable
pub fn new() -> Self
Sourcepub async fn register_promise(&self, promise_id: PromiseId, call_id: CallId)
pub async fn register_promise(&self, promise_id: PromiseId, call_id: CallId)
Register a new pending promise
Sourcepub async fn add_dependency(
&self,
promise_id: PromiseId,
depends_on: PromiseId,
) -> Result<(), RpcError>
pub async fn add_dependency( &self, promise_id: PromiseId, depends_on: PromiseId, ) -> Result<(), RpcError>
Add a dependency between promises
Sourcepub async fn resolve_by_call(
&self,
call_id: CallId,
result: Value,
) -> Option<PromiseId>
pub async fn resolve_by_call( &self, call_id: CallId, result: Value, ) -> Option<PromiseId>
Resolve a promise by call ID
Sourcepub async fn resolve_promise(&self, promise_id: PromiseId, result: Value)
pub async fn resolve_promise(&self, promise_id: PromiseId, result: Value)
Resolve a promise directly
Sourcepub async fn get_ready_promises(&self) -> Vec<PromiseId>
pub async fn get_ready_promises(&self) -> Vec<PromiseId>
Get promises that are ready to execute (all dependencies resolved)
Sourcepub async fn get_result(&self, promise_id: &PromiseId) -> Option<Value>
pub async fn get_result(&self, promise_id: &PromiseId) -> Option<Value>
Get the result of a resolved promise
Sourcepub async fn get_execution_order(&self) -> Option<Vec<PromiseId>>
pub async fn get_execution_order(&self) -> Option<Vec<PromiseId>>
Get all promises in topologically sorted order
Sourcepub async fn is_resolved(&self, promise_id: &PromiseId) -> bool
pub async fn is_resolved(&self, promise_id: &PromiseId) -> bool
Check if a promise is resolved
Sourcepub async fn clear_resolved(&self)
pub async fn clear_resolved(&self)
Clear all resolved promises (cleanup)
Sourcepub async fn stats(&self) -> PromiseTableStats
pub async fn stats(&self) -> PromiseTableStats
Get statistics about the promise table
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PromiseTable
impl !RefUnwindSafe for PromiseTable
impl Send for PromiseTable
impl Sync for PromiseTable
impl Unpin for PromiseTable
impl !UnwindSafe for PromiseTable
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more