sclass FunctionsLoader implements AutoCloseable { Set functions; O blob; Throwable exception; bool loading; L onLoaded = syncList(); // also called on fail *(Iterable functions) { functions = asSet(functions); } synchronized void loadInBackground { if (!loading) { loading = true; startThread(r load); } } void load { try { blob = loadFunctions(functions); } catch print e { exception = e; } pcallFAll(onLoaded); } bool loaded() { ret blob != null || exception != null; } public void close { dispose blob; } }