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

Use with tokio #1

Open
gmilleramilar opened this issue Dec 1, 2021 · 2 comments
Open

Use with tokio #1

gmilleramilar opened this issue Dec 1, 2021 · 2 comments

Comments

@gmilleramilar
Copy link

Sorry if this is the wrong place for this question/request, but I'm wondering if this can be used with Tokio. It seems like something would have to implement AsyncRead and/or AsyncWrite. Can you provide an example or pointers on how this might be done?

@tormol
Copy link
Owner

tormol commented Dec 2, 2021

You have to create a new struct containing some tokio type. In tokio 0.2 this would be tokio::io::PollEvented<PosixMq> with the queue opened in nonblocking mode, but that has likely changed in 1.0.
an example with tokio 0.2 from one of my other crates

Since priority can't be passed through the tokio traits, you could maybe add a field in the struct for it and expose a getter and setter.

Thanks in advance :)

@yorickdewid
Copy link

Maybe include an example in the examples directory? I'd reckon many will use tokio in combination with mio.

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

No branches or pull requests

3 participants