luciotato / waitfor

Sequential programming for node.js, end of callback hell / pyramid of doom
MIT License
531 stars 29 forks source link

Wrapping support #18

Closed inancgumus closed 9 years ago

inancgumus commented 10 years ago

I think wrapper for wait.for fibers would be a good idea, what do you think?

I mean:

var $wait = require('wait.for'),
    $r = $wait.waitify(require('heroku-redis-client').createClient());

// instead of: $wait.forMethod($r, 'get', 'counter'));
// we can be able to do:
$r.hgetAsync('counter');  // Async suffix added by waitify call

I've got this xify pattern idea from bluebird promise library. You can do something like that with it:

var $p = require('bluebird'),
    $r = $p.promisifyAll(require('heroku-redis-client').createClient()),
inancgumus commented 10 years ago

@luciotato

luciotato commented 10 years ago

I'm working on LiteScript now. Too many limitations with node imposed async & pure-js.