What is the proper behavior to avoid resource/memory leak? Is it required/correct to cancel
failed Fiber
?
val someEffect: F[Unit] = //...
def someFiber[F[_]: MonadError[?[_], Throwable]](fa: F[Fiber[F, Unit]]): F[Unit] =
for {
fiber <- fa
_ <- fiber.join handleErrorWith { _ =>
//Is this cancel required?
fiber.cancel *> someEffect
}
} yield ()
My concern is about cancel
when handling Fiber.join
error? Is it required?