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

Dependent streams should end when their parent ends #2315

Open
dead-claudia opened this issue Nov 27, 2018 · 2 comments
Open

Dependent streams should end when their parent ends #2315

dead-claudia opened this issue Nov 27, 2018 · 2 comments
Labels
Type: Breaking Change For any feature request or suggestion that could reasonably break existing code Type: Bug For bugs and any other unexpected breakage

Comments

@dead-claudia
Copy link
Member

dead-claudia commented Nov 27, 2018

Expected Behavior

const s = Stream()
const c = stream.map(a => a)
s.end.map(() => console.log('parent ended'))
c.end.map(() => console.log('child ended'))
stream.end(true) // logs "parent ended" and "child ended"

Current Behavior

const s = Stream()
const c = stream.map(a => a)
s.end.map(() => console.log('parent ended'))
c.end.map(() => console.log('child ended'))
stream.end(true) // logs just "parent ended"

Possible Solution

Potentially something down the vein of this comment by @pygy, but it may need altered.

Context

I created this issue to track the issue reported in #2030 (a heavily outdated PR targeting the wrong branch).

@dead-claudia dead-claudia added Type: Bug For bugs and any other unexpected breakage Type: Breaking Change For any feature request or suggestion that could reasonably break existing code labels Nov 27, 2018
@dead-claudia
Copy link
Member Author

dead-claudia commented Nov 27, 2018

Note that the idea here is to close dependent streams after all parent streams close. Things like .map and scan of course only have one, but things like combine would wait for all parent streams to close first before terminating Edit: closing their dependents.

@charlag
Copy link
Contributor

charlag commented Dec 6, 2018

My 50 cents: in Rx stream is closed when it receives Completed event so basically when any of the parent streams are closed flatMap and similar operators swallow inner Completed events of course). While I'm sure they did it for their own reasons, it can be quite confusing, especially in some UI code: hunting down that closed stream can be a pain (considering the same applies for errors).

@dead-claudia dead-claudia moved this to Low priority in Triage/bugs Sep 2, 2024
@dead-claudia dead-claudia mentioned this issue Oct 13, 2024
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Breaking Change For any feature request or suggestion that could reasonably break existing code Type: Bug For bugs and any other unexpected breakage
Projects
Status: Low priority
Development

No branches or pull requests

2 participants