pub struct ProxyTranscodeQueue { /* private fields */ }Expand description
Priority-based proxy transcode queue.
Higher-priority jobs are dispatched first. Within the same priority, earlier submission time wins (FIFO).
Implementations§
Source§impl ProxyTranscodeQueue
impl ProxyTranscodeQueue
Sourcepub fn submit(&mut self, request: ProxyRequest) -> String
pub fn submit(&mut self, request: ProxyRequest) -> String
Submit a new request and return the job ID.
Sourcepub fn next_job(&mut self) -> Option<&mut ProxyTranscodeJob>
pub fn next_job(&mut self) -> Option<&mut ProxyTranscodeJob>
Get the next queued job (highest priority, earliest submitted).
Sourcepub fn start_job(&mut self, id: &str, started_at_ms: u64)
pub fn start_job(&mut self, id: &str, started_at_ms: u64)
Mark a job as started at the given timestamp.
Sourcepub fn complete_job(&mut self, id: &str, output: &str)
pub fn complete_job(&mut self, id: &str, output: &str)
Mark a job as successfully completed.
Sourcepub fn cancel_job(&mut self, id: &str)
pub fn cancel_job(&mut self, id: &str)
Cancel a queued job.
Sourcepub fn get(&self, id: &str) -> Option<&ProxyTranscodeJob>
pub fn get(&self, id: &str) -> Option<&ProxyTranscodeJob>
Get a job by ID (immutable).
Sourcepub fn iter(&self) -> impl Iterator<Item = &ProxyTranscodeJob>
pub fn iter(&self) -> impl Iterator<Item = &ProxyTranscodeJob>
Iterate over all jobs.
Trait Implementations§
Source§impl Debug for ProxyTranscodeQueue
impl Debug for ProxyTranscodeQueue
Source§impl Default for ProxyTranscodeQueue
impl Default for ProxyTranscodeQueue
Source§fn default() -> ProxyTranscodeQueue
fn default() -> ProxyTranscodeQueue
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ProxyTranscodeQueue
impl RefUnwindSafe for ProxyTranscodeQueue
impl Send for ProxyTranscodeQueue
impl Sync for ProxyTranscodeQueue
impl Unpin for ProxyTranscodeQueue
impl UnsafeUnpin for ProxyTranscodeQueue
impl UnwindSafe for ProxyTranscodeQueue
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