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)

1  
static new ThreadLocal<L> emit_tl;
2  
sbool emit_print = true;
3  
static new ThreadLocal<S> emit_print_prefix;
4  
static new ThreadLocal<L> emit_onEmit; // L<voidfunc(O)|Runnable>
5  
6  
static void emit(O o) {
7  
  L l = emit_tl!;
8  
  if (l == null) emit_tl.set(l = new L);
9  
  l.add(o);
10  
  if (emit_print) print(optPar(emit_print_prefix, "> ") + o);
11  
  pcallFAll(emit_onEmit!, o);
12  
}

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: 483 / 532
Version history: 8 change(s)
Referenced in: [show references]