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

App getting stuck while using uninterruptible with mapZIOParUnordered #8602

Closed
yash025 opened this issue Jan 3, 2024 · 0 comments · Fixed by #8600
Closed

App getting stuck while using uninterruptible with mapZIOParUnordered #8602

yash025 opened this issue Jan 3, 2024 · 0 comments · Fixed by #8600
Labels
bug Something isn't working stream ZIO Stream

Comments

@yash025
Copy link

yash025 commented Jan 3, 2024

The below code gets stuck and won't print the total size of the stream but it works fine if we replace mapZIOParUnordered with mapZIOPar or if we remove uninterruptible

cc: @adamgfraser

import zio.stream.ZStream

object Main extends ZIOAppDefault {
  val test = ZStream
    .fromIterable(List(1, 2, 3, 4, 5, 6, 7, 9, 10, 11))
    .grouped(3)
    .mapZIOParUnordered(100)(ele => ZIO.logInfo("Chunk of size: " + ele.size).map(_ => ele.size))
    .runSum
    .flatMap(ele => ZIO.logInfo("Total size: " + ele))
    .uninterruptible

  override def run: ZIO[Any with ZIOAppArgs with Scope, Any, Any] =
    test.forever.exit
}```
@adamgfraser adamgfraser added bug Something isn't working stream ZIO Stream labels Jan 3, 2024
@adamgfraser adamgfraser linked a pull request Jan 3, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stream ZIO Stream
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants