azer/indev — pull request #5 by JustinTulloss (2013-09-06 23:41:48+00:00)
Title: Promises

I don't think this works for child tasks yet, but putting this up as a POC.

Now any task can optionally return a promise and it will
wait for that promise to be resolved.

This patch also makes `exec` return a promise that is resolved once
the process exits. This allows us to control the flow better from
the Devfile by returning the result of a call to `exec` that will delay
the transition to the next task, grouping `exec` calls together to
delay the next task, or allowing us to group different `exec` calls
together in different ways to control the flow of the build.

This patch does not put Q in the context for the task, with the belief
that for now, exposing it through the return value for `exec` is enough.