Skip to content

Instantly share code, notes, and snippets.

@zainab-ali
Last active October 15, 2024 15:19
Show Gist options
  • Save zainab-ali/84ba2f82480ea3e95d059fd92cac02f4 to your computer and use it in GitHub Desktop.
Save zainab-ali/84ba2f82480ea3e95d059fd92cac02f4 to your computer and use it in GitHub Desktop.
Aquascape describing `parEvalMapUnordered` and chunk preservation semantics.
//> using dep "com.github.zainab-ali::aquascape::0.3.0"
import fs2.*
import cats.effect.*
import aquascape.*
import cats.syntax.all.*
object App extends AquascapeApp {
def name: String = "aquascape"
override def chunked: Boolean = true
def stream(using Scape[IO]) = {
Stream('a', 'b', 'c')
.covary[IO]
.stage("Stream('a','b','c')", "upstream")
.fork("root", "upstream")
.parEvalMapUnordered(3)(c => c.pure[IO].trace())
.stage("parEvalMapUnordered(3)(…)")
.compile
.drain
.compileStage("compile.drain")
}
}
@zainab-ali
Copy link
Author

aquascape

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment