pub struct AsyncResult<S: ResultStore> { /* private fields */ }Expand description
AsyncResult handle for querying task results (Celery-compatible API)
Implementations§
Source§impl<S: ResultStore + Clone> AsyncResult<S>
impl<S: ResultStore + Clone> AsyncResult<S>
Sourcepub fn with_parent(task_id: TaskId, store: S, parent: AsyncResult<S>) -> Self
pub fn with_parent(task_id: TaskId, store: S, parent: AsyncResult<S>) -> Self
Create an AsyncResult with a parent
Sourcepub fn with_children(
task_id: TaskId,
store: S,
children: Vec<AsyncResult<S>>,
) -> Self
pub fn with_children( task_id: TaskId, store: S, children: Vec<AsyncResult<S>>, ) -> Self
Create an AsyncResult with children (for group/chord results)
Sourcepub fn parent(&self) -> Option<&AsyncResult<S>>
pub fn parent(&self) -> Option<&AsyncResult<S>>
Get the parent result if this is a linked task
Sourcepub fn children(&self) -> &[AsyncResult<S>]
pub fn children(&self) -> &[AsyncResult<S>]
Get child results (for group/chord tasks)
Sourcepub fn add_child(&mut self, child: AsyncResult<S>)
pub fn add_child(&mut self, child: AsyncResult<S>)
Add a child result
Sourcepub async fn children_ready(&self) -> Result<bool>
pub async fn children_ready(&self) -> Result<bool>
Check if all children are ready (completed)
Sourcepub async fn collect_children(
&self,
timeout: Option<Duration>,
) -> Result<Vec<Option<Value>>>
pub async fn collect_children( &self, timeout: Option<Duration>, ) -> Result<Vec<Option<Value>>>
Get results from all children
Returns a vector of results in the same order as children were added. Returns an error if any child failed.
Sourcepub async fn successful(&self) -> Result<bool>
pub async fn successful(&self) -> Result<bool>
Check if the task completed successfully
Sourcepub async fn info(&self) -> Result<Option<TaskResultValue>>
pub async fn info(&self) -> Result<Option<TaskResultValue>>
Get task information/metadata
Sourcepub async fn result(&self) -> Result<Option<Value>>
pub async fn result(&self) -> Result<Option<Value>>
Get the result without blocking
Returns None if the task is not yet complete
Trait Implementations§
Source§impl<S: Clone + ResultStore> Clone for AsyncResult<S>
impl<S: Clone + ResultStore> Clone for AsyncResult<S>
Source§fn clone(&self) -> AsyncResult<S>
fn clone(&self) -> AsyncResult<S>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<S: ResultStore + Clone> Debug for AsyncResult<S>
impl<S: ResultStore + Clone> Debug for AsyncResult<S>
Auto Trait Implementations§
impl<S> Freeze for AsyncResult<S>where
S: Freeze,
impl<S> RefUnwindSafe for AsyncResult<S>where
S: RefUnwindSafe,
impl<S> Send for AsyncResult<S>
impl<S> Sync for AsyncResult<S>
impl<S> Unpin for AsyncResult<S>where
S: Unpin,
impl<S> UnwindSafe for AsyncResult<S>where
S: UnwindSafe,
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