Skip to content

Commit

Permalink
pretty
Browse files Browse the repository at this point in the history
  • Loading branch information
ValdemarGr committed Sep 7, 2024
1 parent 9249dbd commit 931d205
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ object NewDesign {
// }

final case class Context[F[_]](
sup: effect.std.Supervisor[F],
path: Set[Unique.Token],
state: Ref[F, State[F]],
parentLease: Resource[F, Option[Int]],
Expand Down Expand Up @@ -288,12 +289,13 @@ object NewDesign {
leaseResource <- resourcePull
(result, fibs) <- child.eval(hd, mkCtx(killThis.get, leaseResource))
cancelAll = fibs.parTraverse_(_.cancel)
bigProg = repeatUncons(tl, cancelAll).stream
.interruptWhen(ctx.interruptContext.attempt)
.compile
.drain
.start
ensureCleanup = (ctx.interruptContext *> cancelAll).start
bigProg = ctx.sup.supervise {
repeatUncons(tl, cancelAll).stream
.interruptWhen(ctx.interruptContext.attempt)
.compile
.drain
}
ensureCleanup = ctx.sup.supervise(ctx.interruptContext *> cancelAll)
fiber <- Pull.eval(ensureCleanup *> bigProg)
} yield result -> List(fiber)
}
Expand Down

0 comments on commit 931d205

Please sign in to comment.