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

fix xs.merge completion #76

Merged
merged 1 commit into from
Jul 11, 2016
Merged

fix xs.merge completion #76

merged 1 commit into from
Jul 11, 2016

Conversation

Hypnosphi
Copy link
Contributor

@Hypnosphi Hypnosphi commented Jul 10, 2016

This is intended to fix #74

The problem it that case is that MergeProducer#_stop method never gets called because of cancelled async stoppage. So when original stream gets executed second time and then completed, the ac counter goes to -1 and that doesn't lead to merged stream completion.

The idea of PR is that we can be sure about (virtual) count of active listeners right before we iterate through insArr and call _adds, because each of the incoming streams either runs already or gets started by _add.

There's still a potential problem in case if some incoming stream gets restarted by another listener. To fix that, merge should be rewritten in the manner of combine to track which of the streams actually completes.

@staltz staltz merged commit 5bbcade into staltz:master Jul 11, 2016
@staltz
Copy link
Owner

staltz commented Jul 11, 2016

Thanks a lot @Hypnosphi , this was perfect fix.

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

Successfully merging this pull request may close these issues.

xs.merge() bug - fixed by debug()
2 participants