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

eachSocket behaves as synchronous without filter, but async with filter #248

p16 opened this issue Jun 28, 2018 · 2 comments


Copy link

@p16 p16 commented Jun 28, 2018

Hi there,
when using the subscription filter I think the eachSocket function behaves as async instead of synchronous.

route.subscribers._forEachSubscriber is used in eachSocket but its definition makes it an async function.

I'm open to work on a fix on this, but I'm not sure how to proceed given the each function passed to _forEachSubscriber sometimes is synchronous and sometimes is async.

Do you have any idea?

@mtharrison mtharrison added the bug label Jul 2, 2018

This comment has been minimized.

Copy link

@mtharrison mtharrison commented Jul 2, 2018

Good spot. As we accept an async each() we probably need to return Promises from the functions that call that and document appropriately.

@hueniverse hueniverse self-assigned this Apr 18, 2019
@hueniverse hueniverse added this to the 11.0.0 milestone Apr 18, 2019

This comment has been minimized.

Copy link

@hueniverse hueniverse commented Apr 18, 2019

The resolution is to move the entire interface to async. In most cases this would not be a breaking change, but some operations (as seen in the test) would now require an await next to eachSocket().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.