cksac / dataloader-rs

Rust implementation of Facebook's DataLoader using async-await.
Apache License 2.0
261 stars 23 forks source link

LRU-based cache implementation #30

Closed luisjakon closed 2 years ago

luisjakon commented 3 years ago

Would it be possible to include an lru-based cache implementation in order to better manage memory consumption? Something like https://github.com/maidsafe/lru_time_cache would be very useful.

On a side note, is there any particular reason the yield_count property hard-coded to 10? Thanks!

cksac commented 3 years ago

you can implement Cache for cached::Loader https://github.com/cksac/dataloader-rs/blob/master/src/cached.rs#L8

10 is default value, you can change it by with_yield_count when creating the loader