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

49
LINES

< > BotCompany Repo | #1010675 // postSoftwareMadeWeb

JavaX fragment (include)

1  
static new ThreadLocal<Bool> postSoftwareMadeWeb_disabled;
2  
static new BetterThreadLocal<Int> postSoftwareMadeWeb_websMadeInThread;
3  
static new ThreadLocal<S> postSoftwareMadeWeb_maker;
4  
static new ThreadLocal<S> postSoftwareMadeWeb_programID;
5  
static S postSoftwareMadeWeb_programID_allThreads;
6  
7  
// L<voidfunc(Web web)>
8  
// function can also return false to stop triggerWebsChanged
9  
static L postSoftwareMadeWeb_onNewWeb = synchroList();
10  
11  
// L<voidfunc(Web web)>
12  
static L postSoftwareMadeWeb_onDisabledPost = synchroList();
13  
14  
static void postSoftwareMadeWeb(Web web, O... params) {
15  
  lock aiLock();
16  
  web_intern(web);
17  
  incIntThreadLocal(postSoftwareMadeWeb_websMadeInThread);
18  
  
19  
  S progID = postSoftwareMadeWeb_programID();
20  
  
21  
  S maker = postSoftwareMadeWeb_maker!;
22  
  if (maker != null)
23  
    if (empty(web.source)) web.source = maker;
24  
    else params = paramsPlus(params, 'maker, postSoftwareMadeWeb_maker!);
25  
26  
  if (isTrue(postSoftwareMadeWeb_disabled!)) {
27  
    print("  Would post: " + webToStringShort(web) + " [" + web.source + "]");
28  
    pcallFAll(postSoftwareMadeWeb_onDisabledPost, web);
29  
  } else {
30  
    logStructure(postSoftwareMadeWeb_file(), nu(SoftwareMadeWeb,
31  
      date := now(),
32  
      computerID := computerID(),
33  
      programID := progID,
34  
      //structure := struct(web),
35  
      +web,
36  
      furtherInfo := empty(params) ? null : litorderedmap(params)));
37  
      
38  
    markWebsPosted_createMarker(progID);
39  
    pcallFAll(postSoftwareMadeWeb_onNewWeb, web);
40  
  }
41  
}
42  
43  
static S postSoftwareMadeWeb_programID() {
44  
  ret or2(postSoftwareMadeWeb_programID!, postSoftwareMadeWeb_programID_allThreads, programID());
45  
}
46  
47  
static File postSoftwareMadeWeb_file() {
48  
  ret getProgramFile(postSoftwareMadeWeb_programID(), "webs-made.txt");
49  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1010675
Snippet name: postSoftwareMadeWeb
Eternal ID of this version: #1010675/28
Text MD5: 6b149f07e13953d752a713c9d029cc29
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-02-27 10:33:04
Source code size: 1772 bytes / 49 lines
Pitched / IR pitched: No / No
Views / Downloads: 626 / 614
Version history: 27 change(s)
Referenced in: [show references]