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 var.
- 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.
Some Thoughts
ResourceDatais not asynchronous, because it must return a certain result, the loading is completed or$Failed.
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];
then try var = f["file","url"], this may useful.