Skip to content

Commit 293252f

Browse files
authored
Merge pull request #77 from alexcrichton/reorg
Drastically simplify with ideas from tokio
2 parents 45f9ade + 09e30cb commit 293252f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+1947
-4198
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ members = [
3131

3232
[dependencies]
3333
log = "0.3"
34+
scoped-tls = "0.1"

futures-cpupool/src/lib.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ use std::sync::atomic::{AtomicUsize, Ordering};
5555
use std::thread;
5656

5757
use crossbeam::sync::MsQueue;
58-
use futures::{Future, oneshot, Oneshot, Task, Poll};
58+
use futures::{Future, oneshot, Oneshot, Poll};
5959

6060
/// A thread pool intended to run CPU intensive work.
6161
///
@@ -190,15 +190,11 @@ impl<R: Send + 'static> Future for CpuFuture<R> {
190190
type Item = R;
191191
type Error = Box<Any + Send>;
192192

193-
fn poll(&mut self, task: &mut Task) -> Poll<R, Box<Any + Send>> {
194-
match self.inner.poll(task) {
193+
fn poll(&mut self) -> Poll<R, Box<Any + Send>> {
194+
match self.inner.poll() {
195195
Poll::Ok(res) => res.into(),
196196
Poll::Err(_) => panic!("shouldn't be canceled"),
197197
Poll::NotReady => Poll::NotReady,
198198
}
199199
}
200-
201-
fn schedule(&mut self, task: &mut Task) {
202-
self.inner.schedule(task)
203-
}
204200
}

futures-cpupool/tests/smoke.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use futures::Future;
1010
use futures_cpupool::CpuPool;
1111

1212
fn get<F>(f: F) -> Result<F::Item, F::Error>
13-
where F: Future + Send,
13+
where F: Future + Send + 'static,
1414
F::Item: Send,
1515
F::Error: Send,
1616
{

futures-curl/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ curl = "0.3.3"
1616
futures = { path = "..", version = "0.1" }
1717
futures-io = { path = "../futures-io", version = "0.1" }
1818
futures-mio = { path = "../futures-mio", version = "0.1" }
19+
libc = "0.2"
1920
log = "0.3"
2021
mio = { git = "https://github.com/carllerche/mio" }
2122
scoped-tls = "0.1"

0 commit comments

Comments
 (0)