pub fn num_threads(mut self, num_threads: usize) -> Builder {
        assert!(num_threads > 0);
        self.num_threads = Some(num_threads);
        self
    }
/// Set the maximum number of worker-threads that will be alive at any given moment by the built
/// [`Pool`]. If not specified, defaults the number of threads to the number of CPUs.
///
/// [`Pool`]: struct.Pool.html
///
/// # Panics
///
/// This method will panic if `num_threads` is 0.
///
/// # Examples
///
/// No more than eight threads will be alive simultaneously for this pool:
///
/// ```
/// # extern crate workerpool;
/// use std::thread;
/// use workerpool::{Builder, Pool};
/// use workerpool::thunk::{Thunk, ThunkWorker};
///
/// # fn main() {
/// let pool: Pool<ThunkWorker<()>> = Builder::new()
///     .num_threads(8)
///     .build();
///
/// for _ in 0..100 {
///     pool.execute(Thunk::of(|| {
///         println!("Hello from a worker thread!")
///     }))
/// }
/// # }
/// ```
Set the maximum number of worker-threads that will be alive at any given moment by the built
[`Pool`]. If not specified, defaults the number of threads to the number of CPUs.


Set the maximum number of worker - threads that will be alive at any given moment by the built [ ` Pool ` ] . If not specified defaults the number of threads to the number of CPUs .
pub fn num_threads(mut self, num_threads: usize) -> Builder {
        assert!(num_threads > 0);
        self.num_threads = Some(num_threads);
        self
    }
pub fn num_threads ( mut self , num_threads : usize ) -> Builder { assert ! ( num_threads 0 ) ; self . num_threads = Some ( num_threads ) ; self }
Set the maximum number of worker-threads that will be alive at any given moment by the built
[`Pool`].
Set the maximum number of worker - threads that will be alive at any given moment by the built [ ` Pool ` ] .
mut self
num_threads
usize
mut self
num_threads
usize
panics
This method will panic if `num_threads` is 0.
This method will panic if ` num_threads ` is 0 .
examples
No more than eight threads will be alive simultaneously for this pool.


No more than eight threads will be alive simultaneously for this pool .
extern crate workerpool;
use std::thread;
use workerpool::{Builder, Pool};
use workerpool::thunk::{Thunk, ThunkWorker}.
use std :: thread ; use workerpool :: { Builder Pool } ; use workerpool :: thunk :: { Thunk ThunkWorker } .
fn main() {
let pool: Pool> = Builder::new()
.num_threads(8)
.build().

for _ in 0..100 {
pool.execute(Thunk::of(|| {
println!("Hello from a worker thread!")
}))
}
let pool : Pool > = Builder :: new () . num_threads ( 8 ) . build () . for _ in 0 .. 100 { pool . execute ( Thunk :: of ( || { println! ( " Hello from a worker thread! " ) } )) }
}
None