Creates a cats.effect.kernel.Resource scope within which fibers can be monitored. When this scope exits, all supervised fibers will be finalized.
Value parameters
await
the termination policy
true - wait for the completion of the active fibers
false - cancel the active fibers
Attributes
Note
if an effect that never completes, is supervised by a Supervisor with awaiting termination policy, the termination of the Supervisor is indefinitely suspended
val io: IO[Unit] = // never completes
Supervisor[IO](await = true).use { supervisor =>
supervisor.supervise(IO.never).void
}