pub struct WorkerPool { /* private fields */ }Expand description
Worker pool for parallel tile loading
Implementations§
Source§impl WorkerPool
impl WorkerPool
Sourcepub fn new(pool_size: usize) -> WasmResult<Self>
pub fn new(pool_size: usize) -> WasmResult<Self>
Creates a new worker pool
Sourcepub fn submit_job(
&mut self,
request: WorkerJobRequest,
timestamp: f64,
timeout_ms: u64,
) -> WasmResult<JobId>
pub fn submit_job( &mut self, request: WorkerJobRequest, timestamp: f64, timeout_ms: u64, ) -> WasmResult<JobId>
Submits a job to the pool
Sourcepub fn handle_response(
&mut self,
worker_id: u32,
response: WorkerJobResponse,
timestamp: f64,
) -> WasmResult<()>
pub fn handle_response( &mut self, worker_id: u32, response: WorkerJobResponse, timestamp: f64, ) -> WasmResult<()>
Handles a worker response
Sourcepub fn job_status(&self, job_id: JobId) -> Option<JobStatus>
pub fn job_status(&self, job_id: JobId) -> Option<JobStatus>
Returns the job status
Sourcepub fn cancel_job(&mut self, job_id: JobId) -> WasmResult<()>
pub fn cancel_job(&mut self, job_id: JobId) -> WasmResult<()>
Cancels a job
Sourcepub fn cleanup_jobs(&mut self)
pub fn cleanup_jobs(&mut self)
Clears completed and failed jobs
Auto Trait Implementations§
impl Freeze for WorkerPool
impl RefUnwindSafe for WorkerPool
impl Send for WorkerPool
impl Sync for WorkerPool
impl Unpin for WorkerPool
impl UnsafeUnpin for WorkerPool
impl UnwindSafe for WorkerPool
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