pub struct TransactionTaskSpawner { /* private fields */ }Expand description
Cloneable handle workers use to spawn owned tasks without holding JoinHandles.
Implementations§
Source§impl TransactionTaskSpawner
impl TransactionTaskSpawner
Sourcepub async fn spawn<F>(
&self,
class: TaskClass,
future: F,
) -> Result<TaskId, SpawnReject>
pub async fn spawn<F>( &self, class: TaskClass, future: F, ) -> Result<TaskId, SpawnReject>
Register then spawn future under class.
Uses try_send so workers never block forever on a full mailbox while the
supervisor is in abort_and_drain. On Busy/Rejected before accept, the
boxed future is returned so the caller can drive cleanup inline. On
SpawnReject::Orphaned, the future is gone from the caller — fail closed.
Sourcepub async fn spawn_boxed(
&self,
class: TaskClass,
future: Pin<Box<dyn Future<Output = ()> + Send + 'static>>,
) -> Result<TaskId, SpawnReject>
pub async fn spawn_boxed( &self, class: TaskClass, future: Pin<Box<dyn Future<Output = ()> + Send + 'static>>, ) -> Result<TaskId, SpawnReject>
Same as Self::spawn with an already-boxed future (Busy retry).
Sourcepub fn try_spawn_owned<F>(
&self,
class: TaskClass,
future: F,
) -> Result<(), SpawnReject>
pub fn try_spawn_owned<F>( &self, class: TaskClass, future: F, ) -> Result<(), SpawnReject>
Sync try-spawn for ToolRuntime::start (no await). On success the supervisor
owns the future; TaskId reply may be dropped (caller does not need it).
Sourcepub async fn spawn_with_busy_retry<F, C>(
&self,
class: TaskClass,
future: F,
max_retries: u32,
is_cancelled: C,
) -> Result<TaskId, SpawnReject>
pub async fn spawn_with_busy_retry<F, C>( &self, class: TaskClass, future: F, max_retries: u32, is_cancelled: C, ) -> Result<TaskId, SpawnReject>
Prefer supervisor ownership: bounded Busy retries, then return the last reject.
Does not drive the future inline — caller decides fail-closed vs last-resort join.
Trait Implementations§
Source§impl Clone for TransactionTaskSpawner
impl Clone for TransactionTaskSpawner
Source§fn clone(&self) -> TransactionTaskSpawner
fn clone(&self) -> TransactionTaskSpawner
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more