pub fn execute(&self, inp: T::Input) {
        self.shared_data.queued_count.fetch_add(1, Ordering::SeqCst);
        let job = (inp, None);
        self.jobs
            .lock()
            .send(job)
            .expect("Pool::execute unable to send job into queue.");
    }
/// Executes with the input on a worker in the pool.
/// Non-blocking and disregards output of the worker's execution.
///
/// # Examples
///
/// Execute four jobs on a thread pool that can run two jobs concurrently:
///
/// ```
/// # extern crate workerpool;
/// use workerpool::Pool;
/// use workerpool::thunk::{Thunk, ThunkWorker};
///
/// # fn main() {
/// let pool: Pool<ThunkWorker<()>> = Pool::new(2);
/// pool.execute(Thunk::of(|| println!("hello")));
/// pool.execute(Thunk::of(|| println!("world")));
/// pool.execute(Thunk::of(|| println!("foo")));
/// pool.execute(Thunk::of(|| println!("bar")));
/// pool.join();
/// # }
/// ```
Executes with the input on a worker in the pool.
Non-blocking and disregards output of the worker's execution.
Executes with the input on a worker in the pool . Non - blocking and disregards output of the worker ' s execution .
pub fn execute(&self, inp: T::Input) {
        self.shared_data.queued_count.fetch_add(1, Ordering::SeqCst);
        let job = (inp, None);
        self.jobs
            .lock()
            .send(job)
            .expect("Pool::execute unable to send job into queue.");
    }
pub fn execute ( & self , inp : T :: Input ) { self . shared_data . queued_count . fetch_add ( 1 , Ordering :: SeqCst ) ; let job = ( inp , None ) ; self . jobs . lock ( ) . send ( job ) . expect ( " " ) ; }
Executes with the input on a worker in the pool.
Executes with the input on a worker in the pool .
&self
inp
T::Input
&self
inp
T::Input
examples
Execute four jobs on a thread pool that can run two jobs concurrently.


Execute four jobs on a thread pool that can run two jobs concurrently .
extern crate workerpool;
use workerpool::Pool;
use workerpool::thunk::{Thunk, ThunkWorker}.
use workerpool :: Pool ; use workerpool :: thunk :: { Thunk ThunkWorker } .
fn main() {
let pool: Pool> = Pool::new(2);
pool.execute(Thunk::of(|| println!("hello")));
pool.execute(Thunk::of(|| println!("world")));
pool.execute(Thunk::of(|| println!("foo")));
pool.execute(Thunk::of(|| println!("bar")));
pool.join().
let pool : Pool > = Pool :: new ( 2 ) ; pool . execute ( Thunk :: of ( || println! ( " hello " ))) ; pool . execute ( Thunk :: of ( || println! ( " world " ))) ; pool . execute ( Thunk :: of ( || println! ( " foo " ))) ; pool . execute ( Thunk :: of ( || println! ( " bar " ))) ; pool . join () .
}
None