mirror of
https://github.com/fafhrd91/actix-net
synced 2025-02-17 14:43:31 +01:00
use parking_lot 0.10
This commit is contained in:
parent
33fd6adc11
commit
37bedff6fb
@ -1,5 +1,11 @@
|
|||||||
# Changes
|
# Changes
|
||||||
|
|
||||||
|
## [0.3.1] - 2019-12-12
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
* Use parking_lot 0.10
|
||||||
|
|
||||||
## [0.3.0] - 2019-12-02
|
## [0.3.0] - 2019-12-02
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "actix-threadpool"
|
name = "actix-threadpool"
|
||||||
version = "0.3.0"
|
version = "0.3.1"
|
||||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||||
description = "Actix thread pool for sync code"
|
description = "Actix thread pool for sync code"
|
||||||
keywords = ["actix", "network", "framework", "async", "futures"]
|
keywords = ["actix", "network", "framework", "async", "futures"]
|
||||||
@ -19,9 +19,9 @@ path = "src/lib.rs"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
derive_more = "0.99.2"
|
derive_more = "0.99.2"
|
||||||
futures = "0.3.1"
|
futures-channel = "0.3.1"
|
||||||
parking_lot = "0.9"
|
parking_lot = "0.10"
|
||||||
lazy_static = "1.2"
|
lazy_static = "1.3"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
num_cpus = "1.10"
|
num_cpus = "1.10"
|
||||||
threadpool = "1.7"
|
threadpool = "1.7"
|
||||||
|
@ -6,7 +6,7 @@ use std::pin::Pin;
|
|||||||
use std::task::{Context, Poll};
|
use std::task::{Context, Poll};
|
||||||
|
|
||||||
use derive_more::Display;
|
use derive_more::Display;
|
||||||
use futures::channel::oneshot;
|
use futures_channel::oneshot;
|
||||||
use parking_lot::Mutex;
|
use parking_lot::Mutex;
|
||||||
use threadpool::ThreadPool;
|
use threadpool::ThreadPool;
|
||||||
|
|
||||||
@ -79,9 +79,12 @@ impl<I, E: fmt::Debug> Future for CpuFuture<I, E> {
|
|||||||
|
|
||||||
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
|
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
|
||||||
let rx = Pin::new(&mut self.rx);
|
let rx = Pin::new(&mut self.rx);
|
||||||
let res = futures::ready!(rx.poll(cx))
|
let res = match rx.poll(cx) {
|
||||||
.map_err(|_| BlockingError::Canceled)
|
Poll::Pending => return Poll::Pending,
|
||||||
.and_then(|res| res.map_err(BlockingError::Error));
|
Poll::Ready(res) => res
|
||||||
|
.map_err(|_| BlockingError::Canceled)
|
||||||
|
.and_then(|res| res.map_err(BlockingError::Error)),
|
||||||
|
};
|
||||||
Poll::Ready(res)
|
Poll::Ready(res)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user