persistent-timeout

1.1.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i persistent-timeout

Weekly Downloads

0

Version

1.1.0

License

MIT

Last publish

Collaborators

  • sorribas