Git Product home page Git Product logo

Comments (6)

yoshuawuyts avatar yoshuawuyts commented on July 26, 2024 2

How to maintain both a async and sync API?

I would recommend only maintaining an async API, and making the switch throughout.

We would require all consumers to also use an async executor if we don't expose both APIs.

That's accurate; within Rust itself that should be no problem (when using async-std). But for integration with other languages I'm not necessarily sure how that would work.

Is it ok to add async_trait as a dependency?

I'd say so; the only downside of this is some extra boxing, compile times, and weird type signatures in docs. But overall it makes life significantly better, so I'd def recommend using it.

from hypercore.

yoshuawuyts avatar yoshuawuyts commented on July 26, 2024 2

I'd probably migrate it as well.

from hypercore.

bltavares avatar bltavares commented on July 26, 2024

@yoshuawuyts thanks for the inputs. Would you also migrate random-access-storage completely to be async, or would you suggest to use the blanket implementation route?

from hypercore.

bltavares avatar bltavares commented on July 26, 2024

There is now a draft PR using async/await on APIs that hit storage: #103

It's built on top of many other PRs tho, so it might take a while to be reviewed and land.

from hypercore.

bltavares avatar bltavares commented on July 26, 2024

@Frando Are you ok if we land PR to close some PRs?

We could release it as a RC version, and them try to investigate blocking or smol to abstract over the async executors in future releases.

from hypercore.

bltavares avatar bltavares commented on July 26, 2024

Landed on the beta versions

from hypercore.

Related Issues (20)

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.