Giter Site home page Giter Site logo

Future/Tokio compatible about rust-igd HOT 6 CLOSED

sbstp avatar sbstp commented on June 24, 2024
Future/Tokio compatible

from rust-igd.

Comments (6)

sbstp avatar sbstp commented on June 24, 2024

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.

from rust-igd.

maufl avatar maufl commented on June 24, 2024

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?

from rust-igd.

sbstp avatar sbstp commented on June 24, 2024

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.

from rust-igd.

maufl avatar maufl commented on June 24, 2024

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?

from rust-igd.

sbstp avatar sbstp commented on June 24, 2024

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.

from rust-igd.

maufl avatar maufl commented on June 24, 2024

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.

from rust-igd.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.