datrs / random-access-disk

Continuously read/write to disk using random offsets and lengths .
Apache License 2.0
27 stars 13 forks source link

Implement async API for random-access-storage #37

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