0.1.0 • Published 12 years ago

bubble v0.1.0

Weekly downloads
26
License
-
Repository
github
Last release
12 years ago

Bubble

Aborts groups of callbacks.

Domains for the poor man.

With timeouts (if you will).

Inspired by substack/node-toss.

Example:

var bubble = require('bubble')
var timeout = 2000

require('http').createServer(function(req, res) {

  var b = bubble(timeout, function(err, file_c_data) {
    if (err) {
      res.writeHead(500)
      res.write(err.message)
    } else {
      res.end(file_c_data)
    }
  });

  fs.readFile('./file_a', h(function(file_a_data) {
    fs.readFile('./file_b', h(function(file_b_data) {
      fs.readFile('./file_c', h())
    })
  }))
})

You can also leave out the timeout:

var b = bubble(timeout, function(err, file_c_data) {
  // ...
});
0.1.0

12 years ago

0.0.5

12 years ago

0.0.4

12 years ago

0.0.3

12 years ago

0.0.2

12 years ago

0.0.1

12 years ago