Dezinater / osrscachereader

A Javascript library that allows you to read Old-School Runescape game files
https://dezinater.github.io/osrscachereader/
BSD 2-Clause "Simplified" License
6 stars 2 forks source link

Calling the same read multiple times with threads loads unneeded data #2

Closed Dezinater closed 1 year ago

Dezinater commented 1 year ago

If you request a certain file multiple times with the threaded option it will start loading the data again since it hasn't fully loaded since the first call. Future calls after the first one should see if it's being loaded instead of checking if its fully loaded. If it's being loaded then just return the first load call's promise

Dezinater commented 1 year ago

This is now fixed with the CacheRequester rewrite. If there is already a pending read it will return the pending read's Promise instead of starting a new read