static ExpiringMap2 mechList_raw_cache = new ExpiringMap2(10000).setMap(ciMap()); static Lock mechList_raw_lock = lock(); // timeout for loading static int mechList_raw_timeout = 60000; static S mechList_raw(S name) ctex { lock mechList_raw_lock; // get from cache S src = mechList_raw_cache.get(name); if (src != null) ret src; // load & put in cache - TODO: make postPage honor this temp tempSetThreadLocal(loadPage_forcedTimeout_byThread, mechList_raw_timeout); src = mechList_raw_fresh(name); if (src != null) mechList_raw_cache.put(name, src); ret src; } static VF2 mechList_raw_listener = voidfunc(S msg, O arg) { if (eq(msg, 'mechChange) && arg instanceof S) { print("Got change notification: " + arg); mechList_raw_cache.remove((S) arg); } }; svoid _onLoad_mechList_raw { add(vm_busListeners_live(), add(mechList_raw_listener); } svoid cleanMeUp_mechList_raw { remove(vm_busListeners_live(), mechList_raw_listener); }