pub fn execute_to(&self, tx: Sender<T::Output>, inp: T::Input) {
        self.shared_data.queued_count.fetch_add(1, Ordering::SeqCst);
        let job = (inp, Some(tx));
        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 sends output of the worker's execution to the given sender.
/// If you want to use [`crossbeam_channel::Sender`] instead of
/// [`std::sync::mpsc::Sender`], enable the `crossbeam` feature for this library.
///
/// # Examples
///
/// Execute four jobs on a thread pool that can run two jobs concurrently:
///
/// ```
/// # extern crate workerpool;
/// # #[cfg(feature = "crossbeam")] extern crate crossbeam_channel;
/// # #[cfg(feature = "crossbeam")] use crossbeam_channel::unbounded as channel;
/// # #[cfg(not(feature = "crossbeam"))]
/// use std::sync::mpsc::channel;
/// use workerpool::Pool;
/// use workerpool::thunk::{Thunk, ThunkWorker};
///
/// # fn main() {
/// let pool: Pool<ThunkWorker<i32>> = Pool::new(2);
/// let (tx, rx) = channel();
/// pool.execute_to(tx.clone(), Thunk::of(|| 1));
/// pool.execute_to(tx.clone(), Thunk::of(|| 2));
/// pool.execute_to(tx.clone(), Thunk::of(|| 3));
/// pool.execute_to(tx.clone(), Thunk::of(|| 4));
/// assert_eq!(10, rx.iter().take(4).sum());
/// # }
/// ```
/// [`crossbeam_channel::Sender`]: http://docs.rs/crossbeam-channel/*/crossbeam_channel/struct.Sender.html
/// [`std::sync::mpsc::Sender`]: https://doc.rust-lang.org/stable/std/sync/mpsc/struct.Sender.html
Executes with the input on a worker in the pool.
Non-blocking and sends output of the worker's execution to the given sender.
Executes with the input on a worker in the pool . Non - blocking and sends output of the worker ' s execution to the given sender .
pub fn execute_to(&self, tx: Sender<T::Output>, inp: T::Input) {
        self.shared_data.queued_count.fetch_add(1, Ordering::SeqCst);
        let job = (inp, Some(tx));
        self.jobs
            .lock()
            .send(job)
            .expect("Pool::execute unable to send job into queue.");
    }
pub fn execute_to ( & self , tx : Sender < T :: Output > , inp : T :: Input ) { self . shared_data . queued_count . fetch_add ( 1 , Ordering :: SeqCst ) ; let job = ( inp , Some ( tx ) ) ; 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
tx
Sender<T::Output>
inp
T::Input
&self
tx
Sender<T::Output>
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;
None
#[cfg(feature = "crossbeam")] extern crate crossbeam_channel;
None
#[cfg(feature = "crossbeam")] use crossbeam_channel::unbounded as channel;
None
#[cfg(not(feature = "crossbeam"))]
use std::sync::mpsc::channel;
use workerpool::Pool;
use workerpool::thunk::{Thunk, ThunkWorker}.
use std :: sync :: mpsc :: channel ; use workerpool :: Pool ; use workerpool :: thunk :: { Thunk ThunkWorker } .
fn main() {
None
}
None