Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

26
LINES

< > BotCompany Repo | #1002224 // hotwireCached - hotwire with cached classes - calls main once per class

JavaX fragment (include)

static new TreeMap<S, Class> hotwireCached_cache;
static Lock hotwireCached_lock = lock();

static Class hotwireCached(S programID) {
  ret hotwireCached(programID, true);
}

static Class hotwireCached(S programID, bool runMain) {
  ret hotwireCached(programID, runMain, false);
}

static Class hotwireCached(S programID, bool runMain, bool dependent) {
  lock hotwireCached_lock;
  
  programID = formatSnippetID(programID);
  Class c = hotwireCached_cache.get(programID);
  if (c == null) {
    c = hotwire(programID);
    if (dependent)
      makeDependent(c);
    if (runMain)
      callMain(c);
    hotwireCached_cache.put(programID, c);
  }
  ret c;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1002224
Snippet name: hotwireCached - hotwire with cached classes - calls main once per class
Eternal ID of this version: #1002224/3
Text MD5: e31a0283971a87238d8dd435ec3b2afb
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-04-19 23:34:38
Source code size: 682 bytes / 26 lines
Pitched / IR pitched: No / No
Views / Downloads: 567 / 1119
Version history: 2 change(s)
Referenced in: [show references]