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

49
LINES

< > BotCompany Repo | #1010675 // postSoftwareMadeWeb

JavaX fragment (include)

static new ThreadLocal<Bool> postSoftwareMadeWeb_disabled;
static new BetterThreadLocal<Int> postSoftwareMadeWeb_websMadeInThread;
static new ThreadLocal<S> postSoftwareMadeWeb_maker;
static new ThreadLocal<S> postSoftwareMadeWeb_programID;
static S postSoftwareMadeWeb_programID_allThreads;

// L<voidfunc(Web web)>
// function can also return false to stop triggerWebsChanged
static L postSoftwareMadeWeb_onNewWeb = synchroList();

// L<voidfunc(Web web)>
static L postSoftwareMadeWeb_onDisabledPost = synchroList();

static void postSoftwareMadeWeb(Web web, O... params) {
  lock aiLock();
  web_intern(web);
  incIntThreadLocal(postSoftwareMadeWeb_websMadeInThread);
  
  S progID = postSoftwareMadeWeb_programID();
  
  S maker = postSoftwareMadeWeb_maker!;
  if (maker != null)
    if (empty(web.source)) web.source = maker;
    else params = paramsPlus(params, 'maker, postSoftwareMadeWeb_maker!);

  if (isTrue(postSoftwareMadeWeb_disabled!)) {
    print("  Would post: " + webToStringShort(web) + " [" + web.source + "]");
    pcallFAll(postSoftwareMadeWeb_onDisabledPost, web);
  } else {
    logStructure(postSoftwareMadeWeb_file(), nu(SoftwareMadeWeb,
      date := now(),
      computerID := computerID(),
      programID := progID,
      //structure := struct(web),
      +web,
      furtherInfo := empty(params) ? null : litorderedmap(params)));
      
    markWebsPosted_createMarker(progID);
    pcallFAll(postSoftwareMadeWeb_onNewWeb, web);
  }
}

static S postSoftwareMadeWeb_programID() {
  ret or2(postSoftwareMadeWeb_programID!, postSoftwareMadeWeb_programID_allThreads, programID());
}

static File postSoftwareMadeWeb_file() {
  ret getProgramFile(postSoftwareMadeWeb_programID(), "webs-made.txt");
}

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: 624 / 612
Version history: 27 change(s)
Referenced in: [show references]