@Alexey
That looks nice, but the shortcoming of such solutions is the burden of error handling falls on the library authors. Unfortunately, in my experience, 3rd party module code failing is the most common source of uncaughtExceptions. This makes perfect sense, since robustness comes after feature-completeness. If I need a dropbox module, and am first to implement one against their new REST API, I'll make sure it works for 100% of my use cases, but not necessarily 100% of all use-cases (I'm a busy man). Nonetheless, I would still open-source and fix any bugs that occur (maybe).
This is a common theme in node: unreliable 3rd-party libraries, and the general advice is, make sure you trust their code like it was your own, but that's a little silly considering we've just met; they seem trustworthy and I need what they're selling... They may even be completely trustworthy, but they have a masochistic penchant for throwing Errors in asynchronous callbacks when a null response would be appropriate (think async version of JSON.parse). I need to know when these failures occur so I can handle and log them appropriately. Intentionally letting the server crash and restarting is an absurd proposition.
@Tim
ATM, domains are easy to break. Here's a quick example of domains failing when nested, whereas trycatch handles the error as expected. Ideally, I'll eventually roll the domain resource management into trycatch, but for now, they don't work for most of my use cases.
Actually, Schoon tore all the old code out. ;P It's only still step in the spirit of it being consecutive steps, for which you very much get credit. =) You should take a look, it's dramatically different.
Here's a quick list of added features:
* Optional centralized async error handling
* Short circuit to next step
* Short circuit to callback on error or uncaught exception
* Short circuit to callback
* Errors on timeout for steps whose callbacks don't get called <- A huge cause of unexpected "no server response" bugs
* Generators for in-step callbacks (steps complete if non are generated, regardless of return value) <- Allows for the base condition of returning something (synchronously) in a step and not worrying about it being undefined and the step not progressing
* Explicit first variable, all arguments, event-style (no error) callback support
* No failure to progress if group generator not called
* $.data shared between steps
* Binding to event emitter events for callbacks
* Composability
* Dependency-injection style substeps via $.run (create a new set of steps from within a step)
Cheers,
Adam Crabtree