pub struct ModelDownloadTracker { /* private fields */ }Expand description
Tracks the status of model downloads through the distributed registry backend.
Implementations§
Source§impl ModelDownloadTracker
impl ModelDownloadTracker
pub fn new(registry: Arc<RegistryManager>) -> Self
Sourcepub async fn get_status(&self, model_name: &str) -> Option<ModelStatus>
pub async fn get_status(&self, model_name: &str) -> Option<ModelStatus>
Gets the status of a model from the registry, bumping last_used_at on hit.
Returns None on lookup failure (error logged) or unknown model.
Sourcepub async fn set_status_and_notify(
&self,
model_name: String,
status: ModelStatus,
provider: ModelProvider,
message: Option<String>,
)
pub async fn set_status_and_notify( &self, model_name: String, status: ModelStatus, provider: ModelProvider, message: Option<String>, )
Sets the status of a model and notifies all waiting channels on this replica.
Sourcepub async fn set_status(
&self,
model_name: String,
status: ModelStatus,
provider: ModelProvider,
)
pub async fn set_status( &self, model_name: String, status: ModelStatus, provider: ModelProvider, )
Sets the status of a model (no message), notifying waiters.
Sourcepub fn add_waiting_channel(
&self,
model_name: &str,
tx: Sender<Result<ModelStatusUpdate, Status>>,
)
pub fn add_waiting_channel( &self, model_name: &str, tx: Sender<Result<ModelStatusUpdate, Status>>, )
Adds a channel that wants updates on a specific model (server-replica-local).
Sourcepub async fn delete_status(&self, model_name: &str)
pub async fn delete_status(&self, model_name: &str)
Deletes a model record from the registry and clears local waiters.
Sourcepub async fn ensure_model_downloaded(
&self,
model_name: &str,
provider: ModelProvider,
tx: &Sender<Result<ModelStatusUpdate, Status>>,
ignore_weights: bool,
) -> ModelStatus
pub async fn ensure_model_downloaded( &self, model_name: &str, provider: ModelProvider, tx: &Sender<Result<ModelStatusUpdate, Status>>, ignore_weights: bool, ) -> ModelStatus
Initiates a download for a model and streams status updates.
Trait Implementations§
Source§impl Clone for ModelDownloadTracker
impl Clone for ModelDownloadTracker
Source§fn clone(&self) -> ModelDownloadTracker
fn clone(&self) -> ModelDownloadTracker
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ModelDownloadTracker
impl !UnwindSafe for ModelDownloadTracker
impl Freeze for ModelDownloadTracker
impl Send for ModelDownloadTracker
impl Sync for ModelDownloadTracker
impl Unpin for ModelDownloadTracker
impl UnsafeUnpin for ModelDownloadTracker
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request