Does Util.Cache() reliably cache the results of asynchronous functions?
Options
Comments
-
I don't see why not. You're caching a task, so on subsequent runs, Util.Cache will return the same (completed) task.
-
Ok great. I was under the impression that all objects needed to be serializable and since tasks weren't, I wasn't sure it would/should work.
-
The serializable restriction applies to types that you've defined in the script itself, when you make changes to the script. For other types, it can re-use the existing object.