Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hang on Promise.resolve(...) #485

Closed
mamaso opened this issue Sep 8, 2016 · 4 comments
Closed

Hang on Promise.resolve(...) #485

mamaso opened this issue Sep 8, 2016 · 4 comments

Comments

@mamaso
Copy link

mamaso commented Sep 8, 2016

This seems to be related to #329 #373 #381

I'm able to get around the problem if I initiate a dummy call to setImmediate or setTimeout which gets the event loop flowing.

Is there a known root cause or fix for this issue in the works?

Sample code below:

    class Program
    {
        public static async Task Start()
        {
            var func = Edge.Func(@"
                return function (data, callback) {

                    // UNCOMMENT TO AVOID HANG
                    // setImmediate(() => {});

                    Promise.resolve('resolve').then((d) => {
                            callback(null, d);
                        })
                        .catch(callback);
                }
            ");

            Console.WriteLine(await func(".net"));
        }
        static void Main(string[] args)
        {
            Start().Wait();
        }
    }
@davideicardi
Copy link

davideicardi commented Nov 8, 2016

Is there any news on this topic? I have the same problem....

@arnaudbzn
Copy link

We do have the same issue.

We use the same workaround:
setImmediate(() => {});

@dpolivy
Copy link
Contributor

dpolivy commented May 2, 2017

This is related to #325. I'm working on a fix; you can follow along in that issue for details.

@dpolivy
Copy link
Contributor

dpolivy commented May 8, 2017

A fix was just released which should address this. See if the latest release ([email protected]) fixes the problem and report back!

@agracio agracio closed this as completed Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants