diff options
Diffstat (limited to 'src/crypto_pool.rs')
-rw-r--r-- | src/crypto_pool.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/crypto_pool.rs b/src/crypto_pool.rs index fefc2f4..51d9dc3 100644 --- a/src/crypto_pool.rs +++ b/src/crypto_pool.rs @@ -5,7 +5,7 @@ use futures::sync::mpsc; use futures::executor; use futures::Sink; use futures::future::*; -use futures_cpupool::CpuPool; +use tokio_threadpool::ThreadPool; use num_cpus; use snow::AsyncTransportState; use std::thread; @@ -50,22 +50,22 @@ pub struct DecryptResult { } pub struct Pool { - pool: CpuPool, + pool: ThreadPool, } impl Pool { pub fn new() -> Self { - let pool = CpuPool::new_num_cpus(); + let pool = ThreadPool::new(); Self { pool } } pub fn send(&self, work: Work) { - self.pool.spawn_fn(move || { + self.pool.spawn(lazy(move || { worker(work); ok::<(), ()>(()) - }).forget(); + })); } } |