jmar777/suspend — pull request #10 by helmus (2013-11-02 14:27:42+00:00)
Title: make sync calls explicity

I'm submitting this PR in response to 1bda954d0da1c508918cdaab59234bef299262b6
Suspend is now using 2 cycles to handle off each callback ( sync or async ) in favour of normalizing sync callbacks.
I'm sure the performance impact of this is minimal but this doesn't feel like the right thing to do.

Adding a ```sync``` resumator option to the resume callback fixes this by allowing to signal that the callback is synchronous.
This also provides better code documentation, when reading through a ```suspend``` function a developer immediately notices if a callback is synchronous or asynchronous.

You could argue that sometimes you don't know if a callback is going to be async or sync, this is really more an inconsistency in the library you are using. But this can of course be fixed by just using the sync resumator which will handle both cases fine.

This PR will break synchronous promises, you can fix this like this:

yield doStuffEventually.then(r.sync);

I don't really know a better way to fix it at this moment. Any feedback is appreciated.