question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

asyncify release zalgo with synchronous functions

See original GitHub issue
const 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:closed
  • Created 6 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
aearlycommented, Feb 1, 2019

This is part of what asyncify does. Wrap all your functions in it and you wont have to worry about synchronous callbacks.

1reaction
eliranmalcommented, Nov 21, 2017

oh ok, i just saw this 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found