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

25
LINES

< > BotCompany Repo | #1025949 // System Queue Monitor Spike

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 911K of libraries. Click here for Pure Java version (4901L/25K).

1  
!7
2  
3  
cmodule SystemQueueMonitorSpike > DynPrintLogAndEnabled {
4  
  transient S lastText;
5  
  
6  
  start {
7  
    doEvery(1.0, r update);
8  
  }
9  
  
10  
  void update enter {
11  
    if (!enabled) ret;
12  
    S text = render();
13  
    if (neq(text, lastText))
14  
      printWithNL(lastText = text);
15  
  }
16  
  
17  
  S render() {
18  
    L<Runnable> l = cast get q(dm_getSystemQ());
19  
    ret empty(l) ? "System queue is empty."
20  
      : firstLetterToUpper(nEntries(l)) + " in system queue. First entries:\n"
21  
      + indentx(lines(syncTakeFirst(3, l)))
22  
      + "\nLast entries:"
23  
      + indentx(lines_rtrim(syncTakeLast(3, l)));
24  
  }
25  
}

Author comment

Began life as a copy of #1025948

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1025949
Snippet name: System Queue Monitor Spike
Eternal ID of this version: #1025949/2
Text MD5: 9408e807a4f93e171e1ceb89be9238d7
Transpilation MD5: 9f101e838bcf90ffa40f1404280b3910
Author: stefan
Category: javax
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-11-02 12:20:55
Source code size: 610 bytes / 25 lines
Pitched / IR pitched: No / No
Views / Downloads: 122 / 243
Version history: 1 change(s)
Referenced in: [show references]