timeout-protector

v0.0.1
provides timeout protection on your async callbacks
timeout async callback protection

Build Status

timeout-protector

Provides a straight forward timeout-protection for any asynchronous callback.

Example

var protector = require('timeout-protector')
async("beep",protector(mycb,5000))

// async is some asynchronous function which may or may not complete

Usage

Wrap the callback, cb like so

protector(cb,timeout,timeoutResponse)

timeout is required.

timeoutResponse defaults to {error:'async timed out'}

npm i timeout-protector

Metadata

  • MIT/X11
  • Whatever
  • David Wee
  • released 5/21/2014

Downloads

Maintainers