A thread pool that supports automatic recovery from panics, allowing threads to restart after a panic. Useful for resilient and fault-tolerant concurrency in network and web programming.
usecrate::*;/// A thread pool that can execute tasks concurrently.
////// Manages a collection of worker threads and provides methods
/// to submit tasks for execution.
////// # Returns
////// - `ThreadPool` - A new thread pool instance.
#[derive(Debug)]pubstructThreadPool{/// The collection of worker threads.
////// # Returns
////// - `Vec<Worker>` - The collection of worker threads.
#[allow(dead_code)]pub(crate)workers:Vec<Worker>,
/// The sender channel for submitting jobs to workers.
////// # Returns
////// - `Sender<ThreadPoolJob>` - The sender channel for submitting jobs to workers.
pub(crate)sender:Sender<ThreadPoolJob>,
}