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

12
LINES

< > BotCompany Repo | #1016141 // emit - general by-thread object emitting mechanism (see getEmits)

JavaX fragment (include)

static new ThreadLocal<L> emit_tl;
sbool emit_print = true;
static new ThreadLocal<S> emit_print_prefix;
static new ThreadLocal<L> emit_onEmit; // L<voidfunc(O)|Runnable>

static void emit(O o) {
  L l = emit_tl!;
  if (l == null) emit_tl.set(l = new L);
  l.add(o);
  if (emit_print) print(optPar(emit_print_prefix, "> ") + o);
  pcallFAll(emit_onEmit!, o);
}

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: #1016141
Snippet name: emit - general by-thread object emitting mechanism (see getEmits)
Eternal ID of this version: #1016141/9
Text MD5: 4270390da83321a25a78c72012e0dc03
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-05-02 18:04:49
Source code size: 371 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 481 / 529
Version history: 8 change(s)
Referenced in: [show references]