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
zio-streams example does not terminate in scala-cli, but does when run in IntelliJ #1933
Comments
Hmm, the following example does run (just adding using lib "dev.zio::zio-streams:2.0.10"
import zio.*
import zio.stream.*
object StreamExample extends ZIOAppDefault {
override val run = {
val points = Chunk(5, 10, 15, 20, 100, 200, 300)
val natStream = ZStream.iterate(0) { i =>
println(i)
i + 1
}
ZIO.foreach(points)(point => natStream.take(point).runCollect.debug)
}
}
StreamExample.main(Array.empty) Maybe it is a ZIO (or ZIO usage) issue. |
Hi @bbarker , Indeed the app hangs in Scala CLI when The code that works in Intellij works in Scala CLI as well (ones using ZIOAppDefault), both when used from within a
|
Hi, I've many examples where scala-cli hangs in script mode, while the same code will run fine in the REPL. I've described some simples examples in #532, in the latest one I didn't find a workaround and I'm stucked :
May be something related to class initialization :
the script I was running :
|
This is not the same issue as for #1905 I've checked and tested with the The full thread dump :
|
Version(s)
This is running on OS X.
Describe the bug
A simple zio-streams example, included below, hangs when used in scala-cli, though it terminates normally when run in IntelliJ as a ZIO App:
To Reproduce
Then try running the script - for me it hangs at the end of executing the first stream (
.take(5)
):Expected behaviour
The script should terminate normally.
The text was updated successfully, but these errors were encountered: