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

14
LINES

< > BotCompany Repo | #1006482 // doEvery_daemon - install a java.util.Timer as daemon [not keeping the VM up]

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (3598L/20K).

// firstDelay = delay
static FixedRateTimer doEvery_daemon(S timerName default defaultTimerName(), long delay, final O r) {
  ret doEvery_daemon(timerName, delay, delay, r);
}

static FixedRateTimer doEvery_daemon(S timerName default defaultTimerName(), long delay, long firstDelay, final O r) {
  FixedRateTimer timer = new(true);
  timer.scheduleAtFixedRate(smartTimerTask(r, timer, delay), firstDelay, delay);
  ret timer;
}

static FixedRateTimer doEvery_daemon(double delaySeconds, final O r) {
  ret doEvery_daemon(toMS(delaySeconds), r);
}

Author comment

Timers are cancelled automatically when program is delicensed

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, sawdedvomwva, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1006482
Snippet name: doEvery_daemon - install a java.util.Timer as daemon [not keeping the VM up]
Eternal ID of this version: #1006482/7
Text MD5: 544145a27104c1235b0b35e57610a7d3
Transpilation MD5: 4516ee1563c42ad5781e7c6c218bdd55
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-07-02 20:24:57
Source code size: 559 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 606 / 698
Version history: 6 change(s)
Referenced in: [show references]