pub struct WorkerOffload { /* private fields */ }Expand description
Installed on the daemon’s engine to route on-device generation through a persistent, auto-respawning worker child. Cheap to clone (shares the child).
Implementations§
Trait Implementations§
Source§impl Clone for WorkerOffload
impl Clone for WorkerOffload
Source§impl LocalGenerationOffload for WorkerOffload
impl LocalGenerationOffload for WorkerOffload
Source§fn generate<'life0, 'async_trait>(
&'life0 self,
_request: GenerateRequest,
) -> Pin<Box<dyn Future<Output = Result<InferenceResult, InferenceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn generate<'life0, 'async_trait>(
&'life0 self,
_request: GenerateRequest,
) -> Pin<Box<dyn Future<Output = Result<InferenceResult, InferenceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Run a non-streaming generation to completion in the worker.
Source§fn stream<'life0, 'async_trait>(
&'life0 self,
_request: GenerateRequest,
) -> Pin<Box<dyn Future<Output = Result<Receiver<StreamEvent>, InferenceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stream<'life0, 'async_trait>(
&'life0 self,
_request: GenerateRequest,
) -> Pin<Box<dyn Future<Output = Result<Receiver<StreamEvent>, InferenceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Run a streaming generation in the worker, returning a receiver of the
same
StreamEvents the in-process path emits. The channel closes when
the worker finishes (or dies); a mid-stream worker death is observed as
the sender dropping, exactly like any other stream end.Source§fn generate_admitted<'life0, 'async_trait>(
&'life0 self,
request: GenerateRequest,
admission: LocalWorkerAdmission,
) -> Pin<Box<dyn Future<Output = Result<LocalOffloadResult, InferenceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn generate_admitted<'life0, 'async_trait>(
&'life0 self,
request: GenerateRequest,
admission: LocalWorkerAdmission,
) -> Pin<Box<dyn Future<Output = Result<LocalOffloadResult, InferenceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Admission-aware extension. The default preserves source compatibility
for external legacy implementers and treats their result as transient;
only implementations that explicitly override this method may report
retained worker/process weights.
fn stream_admitted<'life0, 'async_trait>(
&'life0 self,
request: GenerateRequest,
admission: LocalWorkerAdmission,
) -> Pin<Box<dyn Future<Output = Result<LocalOffloadStream, InferenceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn refresh_resource_policy(&self, generation: u64)
Source§fn resident_allocation_id(&self, model_id: &str) -> Option<String>
fn resident_allocation_id(&self, model_id: &str) -> Option<String>
Exact process-generation allocation owner for parent-side residency
publication. Legacy implementations may omit it and remain transient.
fn resident_models<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn release_model<'life0, 'life1, 'async_trait>(
&'life0 self,
model_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, InferenceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn release_model<'life0, 'life1, 'async_trait>(
&'life0 self,
model_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, InferenceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Release worker-owned residency for one model. Read more
Source§fn release_idle_models<'life0, 'async_trait>(
&'life0 self,
idle_for: Duration,
) -> Pin<Box<dyn Future<Output = Vec<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn release_idle_models<'life0, 'async_trait>(
&'life0 self,
idle_for: Duration,
) -> Pin<Box<dyn Future<Output = Vec<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Release worker-owned model residents whose last completed use is at
least
idle_for old. Legacy offloads do not track residency age.Source§fn terminate_inference<'life0, 'life1, 'async_trait>(
&'life0 self,
inference_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = InferenceTerminationAck> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn terminate_inference<'life0, 'life1, 'async_trait>(
&'life0 self,
inference_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = InferenceTerminationAck> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Terminate the exact isolated process currently executing this ID.
The compatibility default is intentionally conservative: only an exact
kill-and-wait implementation may report confirmed termination.
Auto Trait Implementations§
impl !RefUnwindSafe for WorkerOffload
impl !UnwindSafe for WorkerOffload
impl Freeze for WorkerOffload
impl Send for WorkerOffload
impl Sync for WorkerOffload
impl Unpin for WorkerOffload
impl UnsafeUnpin for WorkerOffload
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more