Skip to content

Set timeouts that survive restarts, persisted with leveldb.

License

Notifications You must be signed in to change notification settings

sorribas/persistent-timeout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

persistent-timeout

Set timeouts that survive restarts, persisted with leveldb.

Usage

In the example below, a timer is set 60 seconds from now. This timer will survive restarts of the script.

var db = getLevelUpSomehow();
var pt = persistentTimeout(db, ontimeout);

pt.timeout(Date.now() + 60000, {foo: 'bar'}); // 60 seconds

function ontimeout (data) {
  console.log(data);
}

License

MIT

About

Set timeouts that survive restarts, persisted with leveldb.

Resources

License

Stars

Watchers

Forks

Packages

No packages published