node-vasync icon indicating copy to clipboard operation
node-vasync copied to clipboard

Add VASYNC_MODE=direct setting

Open j3k0 opened this issue 8 years ago • 1 comments

Some mockup libraries (like testdouble) makes it easy to turn synchronous code into synchronous code (for easier testing).

By default, vasync breaks synchronous flow by calling callbacks inside a setImmediate block.

While this is desirable in production (generally also when running tests), it is also useful to let the user disable this behavior when required.

j3k0 avatar Feb 04 '17 11:02 j3k0

Note, a side effect of this PR is also to stop defining setImmediate() globally when it's not already defined.

j3k0 avatar Feb 04 '17 12:02 j3k0