This question already has an answer here:
I want to build something like
ResourceData to distributing neural network models and paclets.
This system preferably has the following three features.
- It's lazy.
Lazy means it will not load unless you call it.
var := var = Import["path"] will not load until call
- It's asynchronous.
Asynchronous means it does not prevent you from doing other things when loading or downloading.
ResourceData is not asynchronous.
URLDownloadSubmit is asynchronous when downloading.
- It's has a progress bar.
This is not necessary, but it should at least remind you that the download or load is complete.
GeneralUtilities`ProgressPanel["Downloading...","something",0.5], this may helpful but not mult-files available.
ResourceDatais not asynchronous, because it must return a certain result, the loading is completed or
So an asynchronous loading system can return
Missing when it has not finished loading. Then we can use
If[MissingQ@var,Return] to do further processing.
- A possible method of capturing assignment variables
f /: Set[x_, f[y__]] := doSomething[x,y];
var = f["file","url"], this may useful.