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

Tokio 1.0 #301

Merged
merged 1 commit into from
Jan 3, 2021
Merged

Tokio 1.0 #301

merged 1 commit into from
Jan 3, 2021

Conversation

coolreader18
Copy link
Contributor

@coolreader18 coolreader18 commented Dec 29, 2020

Fixes #289

Currently it's compiling and I think it's roughly correct, but it's timing out while waiting for a response, even though the last call to poll_internal comes because read is ready.

@coolreader18
Copy link
Contributor Author

Weird, it looks like IOResource::poll never gets called, even though if I add a manual wake() call after send() in send_with_reply() it seems that poll_read_ready is Ready.

@coolreader18
Copy link
Contributor Author

Yeah, it looks like it can receive one message, and then poll_read_ready never wakes it up again.

@coolreader18
Copy link
Contributor Author

Figured it out, I ran into the same issue as tokio-rs/tokio#3208 (comment)

@diwic
Copy link
Owner

diwic commented Jan 2, 2021

Hi and thanks for working on this!
Given your above fix, what's the current status of the work currently? Stuck somewhere? Ready for merging?

@coolreader18
Copy link
Contributor Author

Oh, yeah, this is pretty much ready to merge if it passes review.

Copy link
Owner

@diwic diwic left a comment

Choose a reason for hiding this comment

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

Ok! So I admit not knowing the inner details of Tokio and trusting that you do the right thing (or that other people will report bugs if you don't...).
So I think this is okay for merging given the two comments above are fixed/commented + that you squash all patches into a single commit.

Good work!

libc = "0.2.69"
tokio = {version = "0.2.4", features=["time", "macros", "io-driver", "rt-core", "rt-util", "rt-threaded", "stream"]}
tokio = {version = "1.0", features=["time", "net"]}
parking_lot = "0.11"
Copy link
Owner

Choose a reason for hiding this comment

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

Unless there is a strong reason not to use std's Mutex, I would prefer to avoid additional dependencies.

inner: ResourceErrorKind
}
#[derive(Debug)]
enum ResourceErrorKind {
Copy link
Owner

Choose a reason for hiding this comment

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

How about we make the enum public and skip "IOResourceError"? Potentially with an added non_exhaustive attribute.

Copy link
Owner

Choose a reason for hiding this comment

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

Also add derive(Clone) btw

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright, wasn't sure whether I should add more public API surface area, since Box<dyn Error> is pretty anonymous, but I guess it makes sense that a dbus IO reactor would fail with either an IO or a dbus error :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, neither of the inner error types implement Clone.

@diwic
Copy link
Owner

diwic commented Jan 3, 2021

And it's in! Thanks!

@coolreader18 coolreader18 deleted the tokio1.0 branch January 3, 2021 06:06
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.

tokio 1.0 support
2 participants