pub struct SqliteImageJobStore { /* private fields */ }Expand description
Durable job state used by the HTTP job manager and history index.
Implementations§
Source§impl SqliteImageJobStore
impl SqliteImageJobStore
Sourcepub async fn open(path: &Path) -> Result<Self, BridgeError>
pub async fn open(path: &Path) -> Result<Self, BridgeError>
Opens storage and applies idempotent migrations.
Sourcepub async fn close(self) -> Result<(), BridgeError>
pub async fn close(self) -> Result<(), BridgeError>
Closes the SQLite worker after pending calls finish.
Sourcepub async fn create(
&self,
auth_scope: &str,
id: &str,
request: &ImageRequest,
now: u64,
max_pending: usize,
max_database_bytes: u64,
) -> Result<SqliteJobSubmission, BridgeError>
pub async fn create( &self, auth_scope: &str, id: &str, request: &ImageRequest, now: u64, max_pending: usize, max_database_bytes: u64, ) -> Result<SqliteJobSubmission, BridgeError>
Inserts a queued request if bounded pending capacity remains.
Sourcepub async fn statistics(&self) -> Result<SqliteJobStatistics, BridgeError>
pub async fn statistics(&self) -> Result<SqliteJobStatistics, BridgeError>
Returns bounded aggregate counters without request, prompt, or path data.
Sourcepub async fn recover_interrupted(&self, now: u64) -> Result<usize, BridgeError>
pub async fn recover_interrupted(&self, now: u64) -> Result<usize, BridgeError>
Marks previously running jobs interrupted without retrying paid work.
Sourcepub async fn queued_identities(
&self,
limit: usize,
) -> Result<Vec<(String, String)>, BridgeError>
pub async fn queued_identities( &self, limit: usize, ) -> Result<Vec<(String, String)>, BridgeError>
Returns oldest-first queued identities across ownership scopes for crash recovery.
Sourcepub async fn claim(
&self,
auth_scope: &str,
id: &str,
now: u64,
) -> Result<bool, BridgeError>
pub async fn claim( &self, auth_scope: &str, id: &str, now: u64, ) -> Result<bool, BridgeError>
Atomically claims one queued job for execution.
Sourcepub async fn progress(
&self,
auth_scope: &str,
id: &str,
stage: &str,
partial_images: u32,
now: u64,
) -> Result<(), BridgeError>
pub async fn progress( &self, auth_scope: &str, id: &str, stage: &str, partial_images: u32, now: u64, ) -> Result<(), BridgeError>
Stores only the latest safe progress label and partial count.
Sourcepub async fn succeed(
&self,
auth_scope: &str,
id: &str,
response: &ImageResponse,
now: u64,
) -> Result<(), BridgeError>
pub async fn succeed( &self, auth_scope: &str, id: &str, response: &ImageResponse, now: u64, ) -> Result<(), BridgeError>
Stores a verified terminal result.
Sourcepub async fn fail(
&self,
auth_scope: &str,
id: &str,
status: ImageJobStatus,
error: &BridgeError,
now: u64,
) -> Result<(), BridgeError>
pub async fn fail( &self, auth_scope: &str, id: &str, status: ImageJobStatus, error: &BridgeError, now: u64, ) -> Result<(), BridgeError>
Stores a structured terminal error or cancellation.
Sourcepub async fn request_cancel(
&self,
auth_scope: &str,
id: &str,
now: u64,
) -> Result<ImageJob, BridgeError>
pub async fn request_cancel( &self, auth_scope: &str, id: &str, now: u64, ) -> Result<ImageJob, BridgeError>
Durably requests cancellation and immediately cancels queued work.
Sourcepub async fn get(
&self,
auth_scope: &str,
id: &str,
) -> Result<ImageJob, BridgeError>
pub async fn get( &self, auth_scope: &str, id: &str, ) -> Result<ImageJob, BridgeError>
Returns one complete job record.
Sourcepub async fn list(
&self,
auth_scope: &str,
filter: ImageJobListFilter,
) -> Result<Vec<ImageJobSummary>, BridgeError>
pub async fn list( &self, auth_scope: &str, filter: ImageJobListFilter, ) -> Result<Vec<ImageJobSummary>, BridgeError>
Lists newest-first summaries using a stable (created,id) cursor.