recoverable_thread_pool/thread_pool/
struct.rs

1use crate::*;
2
3/// A thread pool that can execute tasks concurrently.
4///
5/// Manages a collection of worker threads and provides methods
6/// to submit tasks for execution.
7///
8/// # Returns
9///
10/// - `ThreadPool` - A new thread pool instance.
11#[derive(Debug)]
12pub struct ThreadPool {
13    /// The collection of worker threads.
14    ///
15    /// # Returns
16    ///
17    /// - `Vec<Worker>` - The collection of worker threads.
18    #[allow(dead_code)]
19    pub(super) workers: Vec<Worker>,
20    /// The sender channel for submitting jobs to workers.
21    ///
22    /// # Returns
23    ///
24    /// - `Sender<ThreadPoolJob>` - The sender channel for submitting jobs to workers.
25    pub(super) sender: Sender<ThreadPoolJob>,
26}