pub struct GpuJob {
pub id: String,
pub model: String,
pub request: GenerateRequest,
pub progress_tx: Option<UnboundedSender<SseMessage>>,
pub result_tx: Sender<Result<GenerationJobResult, String>>,
pub output_dir: Option<PathBuf>,
pub config: Arc<RwLock<Config>>,
pub metadata_db: Arc<Option<MetadataDb>>,
pub queue: QueueHandle,
pub registry: SharedJobRegistry,
}Expand description
A job dispatched to a GPU worker thread for processing.
Fields§
§id: StringServer-assigned UUIDv4 carried over from GenerationJob.id. Used by
the worker to flip the registry entry from Queued → Running (and
to remove it when the job finishes), and surfaced to clients via
GET /api/queue for zombie-card reconciliation.
model: String§request: GenerateRequest§progress_tx: Option<UnboundedSender<SseMessage>>§result_tx: Sender<Result<GenerationJobResult, String>>§output_dir: Option<PathBuf>§config: Arc<RwLock<Config>>§metadata_db: Arc<Option<MetadataDb>>Metadata DB handle so the worker can record a row alongside the
on-disk save. Arc<Option<...>> mirrors AppState.metadata_db —
None when the DB failed to open or is disabled.
queue: QueueHandleDecrement the global queue counter when the worker finishes this job.
registry: SharedJobRegistryJob registry handle so the worker can flip state to Running on pickup
and remove the entry on completion / error. Cheap clone — registry is
behind an Arc<RwLock> internally.
Auto Trait Implementations§
impl Freeze for GpuJob
impl !RefUnwindSafe for GpuJob
impl Send for GpuJob
impl Sync for GpuJob
impl Unpin for GpuJob
impl UnsafeUnpin for GpuJob
impl !UnwindSafe for GpuJob
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> 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