pub struct TaskHandle { /* private fields */ }Expand description
Handle returned to the caller when a task is submitted.
Implements Future<Output = ScatterResponse> — awaiting it blocks until
the scheduler delivers a successful response. It will never resolve
to an error; the scheduler retries internally forever.
To add a caller-side deadline use TaskHandle::with_timeout.
Implementations§
Source§impl TaskHandle
impl TaskHandle
Sourcepub async fn with_timeout(
&self,
duration: Duration,
) -> Result<Option<ScatterResponse>, ScatterProxyError>
pub async fn with_timeout( &self, duration: Duration, ) -> Result<Option<ScatterResponse>, ScatterProxyError>
Await the result with a caller-side timeout.
Returns Ok(Some(response)) if the task completes in time, or
Ok(None) if the deadline elapses and the caller should keep waiting on
the same handle later.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TaskHandle
impl !RefUnwindSafe for TaskHandle
impl Send for TaskHandle
impl Sync for TaskHandle
impl Unpin for TaskHandle
impl UnsafeUnpin for TaskHandle
impl !UnwindSafe for TaskHandle
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