datrs / random-access-storage

Abstract interface to implement random-access instances.
Apache License 2.0
14 stars 7 forks source link

Implement async API for random-access-storage #22

Closed bltavares closed 4 years ago

bltavares commented 4 years ago

This commit moves the API from a sync call into async functions using async_trait.

We would like to use async operations on hypercore, and it would be nice to have the underlying storage using async-io when possible. As discussed on https://github.com/datrs/hypercore/issues/97, we could change the API to use async functions on the 'ram' trait.

Async Trait methods are still unstable, but possible using the 'async-trait' crate through a macro.

This PR moves the API to use async-fns. Tests are passing.

Choose one: a 🙋 feature

Checklist

Context

Semver Changes

major as this is a breaking change and we are above 1.0.0

bltavares commented 4 years ago

@substack FYI this would impact eyros also. I would love some feedback.