Skip to content
This repository has been archived by the owner on Dec 8, 2023. It is now read-only.

Future/Tokio compatible #30

Closed
maufl opened this issue Nov 29, 2017 · 6 comments
Closed

Future/Tokio compatible #30

maufl opened this issue Nov 29, 2017 · 6 comments

Comments

@maufl
Copy link
Contributor

maufl commented Nov 29, 2017

Is there a futures aware and tokio compatible version planned?

@sbstp
Copy link
Owner

sbstp commented Nov 29, 2017

Not right now. tokio is being reworked, so I would wait for that before attempting to write it. You can also run this library in a thread pool, giving you the same result. If you want to take a shot at it, I'll review and merge it though.

@maufl
Copy link
Contributor Author

maufl commented Nov 29, 2017

I would probably able to do it. Do you think there should then be always two methods? One that returns a Future but does not block and one that does block? Or should there only be a Future version and a user would call wait to block?

@sbstp
Copy link
Owner

sbstp commented Nov 29, 2017

I wouldn't change the current API. I would also add the tokio support behind a feature flag, so that you can only enable it when you need it. So it would be a separate async API.

@maufl
Copy link
Contributor Author

maufl commented Nov 29, 2017

Hm, hyper works either with or without tokio but not both. Would it be ok if tokio was always used but a synchronous API was still provided?

@sbstp
Copy link
Owner

sbstp commented Nov 29, 2017

No way to avoid it I guess. A lot of people are using the current API, so let's no break it. Just add the async support as a new API.

@maufl
Copy link
Contributor Author

maufl commented Nov 2, 2018

I updated the implementation to adjust for changes in tokio/hyper.
https://github.com/maufl/rust-igd/tree/update-hyper
I'm not sure whether the implementation should be merged, I think the error handling could be improved.

@sbstp sbstp closed this as completed Mar 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants