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).

!7

cmodule SystemQueueMonitorSpike > DynPrintLogAndEnabled {
  transient S lastText;
  
  start {
    doEvery(1.0, r update);
  }
  
  void update enter {
    if (!enabled) ret;
    S text = render();
    if (neq(text, lastText))
      printWithNL(lastText = text);
  }
  
  S render() {
    L<Runnable> l = cast get q(dm_getSystemQ());
    ret empty(l) ? "System queue is empty."
      : firstLetterToUpper(nEntries(l)) + " in system queue. First entries:\n"
      + indentx(lines(syncTakeFirst(3, l)))
      + "\nLast entries:"
      + indentx(lines_rtrim(syncTakeLast(3, l)));
  }
}

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: 118 / 236
Version history: 1 change(s)
Referenced in: [show references]