luciotato / waitfor

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

Can I use? #38

Closed ghost closed 8 years ago

ghost commented 8 years ago

I think about this:

var anchor = locker(1000); //lock maximum 1 seconds
somethingAsync(function() {
  anchor.unlock()
});
lock.lock(); //lock (if not commanded unlock) 

Can I use it?

luciotato commented 8 years ago

I do not follow what are you trying to achieve.

ghost commented 8 years ago

I not try. But I want make synchronization, but lock before callback, and unlock after callback. 26 окт. 2015 г. 21:19 пользователь "Lucio M. Tato" notifications@github.com написал:

I do not follow what are you trying to achieve.

— Reply to this email directly or view it on GitHub https://github.com/luciotato/waitfor/issues/38#issuecomment-151130669.

luciotato commented 8 years ago

maybe:

var anchor = locker(1000); //lock maximum 1 seconds
anchor.lock(); //lock (if not commanded unlock)
var result := wait.for(somethingAsync);
anchor.unlock();
ghost commented 8 years ago

I think last function can be removed. 26 окт. 2015 г. 21:26 пользователь "Lucio M. Tato" notifications@github.com написал:

maybe:

var anchor = locker(1000); //lock maximum 1 seconds anchor.lock(); //lock (if not commanded unlock) var result := wait.for(somethingAsync); anchor.unlock();

— Reply to this email directly or view it on GitHub https://github.com/luciotato/waitfor/issues/38#issuecomment-151132409.

ghost commented 8 years ago

I thinked about wait calling some async function. Or when condition operation (async) will true. 26 окт. 2015 г. 21:30 пользователь "Alexey Solovey" acterhd@gmail.com написал:

I think last function can be removed. 26 окт. 2015 г. 21:26 пользователь "Lucio M. Tato" < notifications@github.com> написал:

maybe:

var anchor = locker(1000); //lock maximum 1 seconds anchor.lock(); //lock (if not commanded unlock) var result := wait.for(somethingAsync); anchor.unlock();

— Reply to this email directly or view it on GitHub https://github.com/luciotato/waitfor/issues/38#issuecomment-151132409.