java_threadpool/
lib.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
mod ThreadPool_rs;
pub use ThreadPool_rs::ThreadPool;
pub use ThreadPool_rs::Future_rs::Future;


#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn tests() {
        let mut thre = ThreadPool::new(2, 3, 5);

        let mut vc = Vec::<Future>::new();
        for i in 0..10 {
            let efef = thre.executor(|| {
                println!("aaaaaaaa");


            });
            vc.push(efef);
        }

        println!("LLLLLLLLLLLLLLLLLLL");

        vc.into_iter().map(|x| {
            x.get();
        }).count();




    }
}