pub struct BatchScheduler { /* private fields */ }Expand description
Scheduler for batch jobs.
Implementations§
Source§impl BatchScheduler
impl BatchScheduler
Sourcepub fn new(insight_store: Arc<InsightStore>) -> Self
pub fn new(insight_store: Arc<InsightStore>) -> Self
Create a new scheduler with default jobs.
Sourcepub async fn run_job(
&self,
job_type: JobType,
input: &BatchInput,
) -> Result<JobRun, String>
pub async fn run_job( &self, job_type: JobType, input: &BatchInput, ) -> Result<JobRun, String>
Run a specific job type immediately.
Sourcepub async fn run_all(&self, input: &BatchInput) -> Vec<JobRun>
pub async fn run_all(&self, input: &BatchInput) -> Vec<JobRun>
Run all jobs.
Sourcepub fn total_runs(&self) -> u64
pub fn total_runs(&self) -> u64
Total runs executed.
Sourcepub fn start_background(
self: Arc<Self>,
input_receiver: Receiver<BatchInput>,
) -> JoinHandle<()>
pub fn start_background( self: Arc<Self>, input_receiver: Receiver<BatchInput>, ) -> JoinHandle<()>
Start background scheduling (non-blocking).
Auto Trait Implementations§
impl !Freeze for BatchScheduler
impl !RefUnwindSafe for BatchScheduler
impl Send for BatchScheduler
impl Sync for BatchScheduler
impl Unpin for BatchScheduler
impl UnsafeUnpin for BatchScheduler
impl !UnwindSafe for BatchScheduler
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> 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