-
Couldn't load subscription status.
- Fork 1.4k
fix : ZStream Broadcastdynamic hanging #9474
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
Conversation
5e7e2aa to
0bc11bf
Compare
|
/claim #9430 |
| )(implicit trace: Trace): ZIO[R with Scope, Nothing, Hub[Take[E1, A1]]] = | ||
| for { | ||
| hub <- ZIO.acquireRelease(Hub.bounded[Take[E1, A1]](capacity))(_.shutdown) | ||
| hub <- Hub.bounded[Take[E1, A1]](capacity) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we never close the Hub? 🤔 Or is it closed by the runIntoHubScoped?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me the Hub is closed by the fromQueueWithShutdown function line 346
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just rollback this line, because as you mention the Hub may not be closed.
e80e705 to
ed28f8f
Compare
|
💵 To receive payouts, sign up on Algora, link your Github account and connect with Stripe. |
|
@gkfabs just FYI the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this kind of escapes the context of this PR, but looking at broadcastDynamic I feel like the description is not quite aligned with the implementation, and that's partially due to the return type:
ZIO[R & Scope, Nothing, ZStream[Any, E, A]]Unless I'm missing something, broadcastDynamic is currently more or less the equivalent of doing the following:
stream.broadcast(1, 2).map(_.head)If we wanted for it to behave the way it's supposed to (at least according to the description) the return type should have been the following, where the outer effect fans out the stream and the inner effect creates a new stream dynamically.
ZIO[R & Scope, Nothing, URIO[Scope, ZStream[Any, E, A]]]What are your thoughts on this? I'm a bit confused at what's the actual use-case for broadcastDynamic given its current behaviour
29147f2 to
2107689
Compare
|
It makes sense to me to change the return type of The current implementation doesn't produce a dynamic number of streams. It just produce one stream. |
2107689 to
408f9c9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to approve this, and we can explore deprecating the method and changing it in the future
/closes #9430
/claim #9430
This PR fixes Issue #9430 by
The fix looks too easy to me, I'm afraid of missing out something, but the test pass.