Last active
March 4, 2024 17:35
-
-
Save zainab-ali/37a752320427c3081488a1c046714340 to your computer and use it in GitHub Desktop.
OOM on infinitely recursive scope
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 scala "3.4.0" | |
//> using lib "co.fs2::fs2-core:3.9.4" | |
import fs2.* | |
import cats.effect.* | |
import cats.effect.unsafe.implicits.global | |
def infiniteStream: Stream[IO, Unit] = | |
(Stream.unit ++ infiniteStream).pull.echo.stream // vs streamNoScope | |
infiniteStream.compile.drain.unsafeRunSync() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment