asyncify release zalgo with synchronous functions
See original GitHub issueconst async = require('async');
function foo(x) { return x + x };
async function bar(x) { return x + x };
var afoo = async.asyncify(foo);
var abar = async.asyncify(bar);
afoo(3, (err, r) => console.log(r));
abar(5, (err, r) => console.log(r));
console.log('Current cycle');
this produce such output:
6
Current cycle
10
I think it’s inconsistent behavior.
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Intentionally unleashing Zalgo with synchronous promises
Releasing Zalgo is, essentially, building a function which could be resolved asynchronously or synchronously, without the caller having any clear signal ...
Read more >novemberborn/release-zalgo
GitHub - novemberborn/release-zalgo: Helps you write code with promise-like chains that can run both synchronously and asynchronously.
Read more >Asyncify — Emscripten 3.1.26-git (dev) documentation
A synchronous call in C that yields to the event loop, which allows browser events to be handled. A synchronous call in C...
Read more >async - Documentation
Async is a utility module which provides straight-forward, powerful functions for working with asynchronous JavaScript. Although originally designed for use ...
Read more >Kyle Simpson asyncify function from You Don't Know JS
The code seems to be an very convoluted way of saying this: function asyncify(cb) { return function() { setTimeout(function() ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is part of what
asyncify
does. Wrap all your functions in it and you wont have to worry about synchronous callbacks.oh ok, i just saw this 😃