Last active
October 15, 2024 15:19
-
-
Save zainab-ali/84ba2f82480ea3e95d059fd92cac02f4 to your computer and use it in GitHub Desktop.
Aquascape describing `parEvalMapUnordered` and chunk preservation semantics.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//> 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") | |
} | |
} |
Author
zainab-ali
commented
Oct 15, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment