Closed james-pre closed 1 year ago
After further consideration (e.g. with HTML5 FS) it may not work. A improved async system could really work though.
On second thought (I know I just closed it), it could serve as a really nice replacement for the current system using transactions.
This will be revisited in a separate issue.
I'm thinking about working on rewriting backends to be much simpler, and changing the internal FS to be more centralized.
For example:
DataBlock could be a class with an id and data property.
Having this would allow for significantly easier maintenance, in addition to streamlining the FS functions.
For dealing with synchronous and asynchronous code, backend functions must return data synchronously. They must also call a callback when any asynchronous code is done running. This allows asynchronous code to be called pseudo-synchronously (e.g. with the cache). While still allowing the asynchronous operations to be properly checked for.
Asynchronous backends (e.g. IndexedDB) must implement a cache internally though (which could easily be done with an AsyncBackend base class).
I think this could be a huge step forward (especially since it makes writing internal FS functions easier).