-
Notifications
You must be signed in to change notification settings - Fork 4
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
Wrapped calls within a runSync block do not resolve #6
Comments
That's possible. I didn't check, this is just an idea looking at this code. Your func functions is called inside a run wrapped environment and does not That may be the case. But I am not exactly sure. BTW: you can call func synchronously once you got the data. On 2015 ජූනි 12, සිකු at පෙ.ව. 5.54 Joseph Abrahamson <
|
I suppose it is, yes. The (external, non-Fibered) function The reason I don't merely return the data and then call Assume we have a function In standard Node.js parlance we might write items.mapConcurrently(
(item, cb) => { cb(null, item+1) },
(err, result) => { console.log(result) }
); Now, I'd like to synchronize this function. The current way I'm doing it is as follows function mapConcurrentlySync(func) {
return Async.runSync((done) => {
items.mapConcurrently(
(item, cb) => { cb(null, func(item)) },
done
);
});
} And now, yeah, it becomes much more clear that |
I understand, concurrent mapping is something does not work with just Don't know. May be this is just seems like an idea for new project :) On Fri, Jun 12, 2015 at 9:32 AM Joseph Abrahamson [email protected]
|
There really ought to be a way, but I think it would require being more specific about the introduction of |
If I have a function
func
being called in arunSync
block atop an item which is only retrieved asynchronouslythen it will succeed so long as
func
is itself a direct, synchronous call. In actuality,func
may be a function derived from a call toAsync.wrap
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?
The text was updated successfully, but these errors were encountered: