Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate threadpool to std::future #46

Closed
wants to merge 1 commit into from

Conversation

semtexzv
Copy link

Contains code to migrate actix-threadpool to std::future, overall progress tracked in #45.

@semtexzv semtexzv force-pushed the std-future-threadpool branch 2 times, most recently from a242109 to 4300996 Compare September 19, 2019 21:10
type Item = I;
type Error = BlockingError<E>;
impl<I> Future for CpuFuture<I> {
type Output = Result<I,Cancelled>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
type Output = Result<I,Cancelled>;
type Output = Result<I, Cancelled>;

Err(err) => Err(BlockingError::Error(err)),
}
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
let rx = Pin::new(&mut Pin::get_mut(self).rx);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let rx = Pin::new(&mut Pin::get_mut(self).rx);
let rx = Pin::new(&mut Pin::get_mut(self).rx);

I think this is not affected by readability.

@@ -19,7 +19,7 @@ path = "src/lib.rs"

[dependencies]
derive_more = "0.15"
futures = "0.1.25"
futures = { package = "futures-preview", version = "0.3.0-alpha.18" }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
futures = { package = "futures-preview", version = "0.3.0-alpha.18" }
futures-preview = "0.3.0-alpha.19"

IMO: futures-preview is more common?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, we should use futures 0.3.0 now

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0.3.1 actually is out for a hotfix

@tyranron
Copy link
Member

tyranron commented Nov 7, 2019

@semtexzv are you still working on this? Would you mind if I collaborate on this PR (so you'll give me access to your fork), or should I redo it from scratch as a separate PR?

@JohnTitor
Copy link
Member

Just note that futures 0.3.0 is out

@cdbattags cdbattags modified the milestone: futures 0.3 Nov 8, 2019
@fafhrd91
Copy link
Member

superseded #59

@fafhrd91 fafhrd91 closed this Nov 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants