pub struct OnCore<'rt, R: ?Sized> { /* private fields */ }Expand description
Placement bound. Every stage is complete on its own — the default it replaces is a real value, not an absent one.
Implementations§
Source§impl<'rt, R: Runtime + ?Sized> OnCore<'rt, R>
impl<'rt, R: Runtime + ?Sized> OnCore<'rt, R>
Sourcepub fn spawn<F>(self, future: F) -> Result<(), SpawnError>
pub fn spawn<F>(self, future: F) -> Result<(), SpawnError>
Spawn a Send future on the first candidate. A future can only be
spawned once, so this does not fall through on back-pressure — use
Self::spawn_with when the placement has more than one candidate.
Sourcepub fn spawn_with<Factory, F, Decide>(
self,
factory: Factory,
decide: Decide,
) -> Result<CoreId, Exhausted>
pub fn spawn_with<Factory, F, Decide>( self, factory: Factory, decide: Decide, ) -> Result<CoreId, Exhausted>
Spawn from a factory, letting the caller decide whether to keep going.
InboxFull drops the future, so recovering means rebuilding it — hence
the factory. What it does not do is decide policy: no delay, no
jitter, no attempt cap live here. decide is called with the 0-based
attempt and the error, and returning true moves to the next candidate.
That split is deliberate. RetryController (backoff, jitter, deadline,
RetryRules) lives in proxima-primitives, which depends on this crate
— so this crate cannot reach it, and baking a policy in here would fork
it. Passing the decision in means a caller composes with whatever it
already holds at its own layer, and decide being a plain FnMut
rather than a trait keeps that composition free.