Skip to content

Wrapped calls within a runSync block do not resolve #6

@tel

Description

@tel

If I have a function func being called in a runSync block atop an item which is only retrieved asynchronously

Async.runSync((done) => {
  asyncProcess((err, thing) => done(err, func(thing)));
});

then it will succeed so long as func is itself a direct, synchronous call. In actuality, func may be a function derived from a call to Async.wrap

function func(thing) {
  return Async.wrap(thing.goGetAnotherThing)();
}

However, in this circumstance it appears that the wrapped function does not resolve properly as in my (convoluted, unsharable as of yet) testing the original call will resolve as null.

It's very possible that there's merely a bug in my code somewhere, but this appears to be some kind of synchronicity/fibers/futures interaction difficulty. Any suggestions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions