futures-cache
Futures-aware cache abstraction.
Provides a cache for asynchronous operations that persist data on the filesystem using sled. The async cache works by accepting a future, but will cancel the accepted future in case the answer is already in the cache.
It requires unique cache keys that are serde serializable. To distinguish across different sub-components of the cache, they can be namespaces using Cache::namespaced.
State
The state of the library is:
- API is limited to only
wrap
, which includes a timeout (#1). - Requests are currently racing in the
wrap
method, so multiple unecessary requests might occur when they should //! instead be queueing up (#2). - Entries only expire when the library is loaded (#3).
- Only storage backend is sled (#4).
Usage
This library requires the user to add the following dependencies to use:
= "0.10.2"
= { = "1.0", = ["derive"]}
Examples
Simple example showcasing fetching information on a github repository.
This is also available as an example you can run with:
use ;
use Serialize;
type Error = ;
async
async