Hi,
So I am building a resource manager for my engine and I have currently gotten stumped as to what approach to take with regards async behaviour.
I have an idea at the moment but i'm not sure if it would be a good approach. (I will just post the ideas for async as it will be very similar for non-async)
Approach
- Request to the resource manager to load a file asynchronously
- Check the file isn't loaded / already loading
- The resource manager creates a new AsyncFileRequest with a callback to load the data from the file, this request is placed in a queue that is handled by the file manager. When the manager picks up the request, it will open the disk file (possibly loaded into a memory stream asynchronously)
- Then calls the callback so that the data can be extracted from the file and the resource can "load" itself using that data
What are your thoughts and suggestions?
How do you architect an Async resource manager
Thanks
** Can a Mod change the title to be spelt correctly please: Asynchronous Resource Manager **