Skip to content

Commit

Permalink
Fix review comments - rename PermitSem to PermitSemaphore
Browse files Browse the repository at this point in the history
  • Loading branch information
geny200 committed Sep 6, 2024
1 parent 9c4d6b3 commit 94bbac7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ final case class SerialSemRef[F[_]: Monad, A](ref: Ref[F, A], sem: Semaphore[F])

/** Default implementation of [[tofu.concurrent.Permit]] that use [[cats.effect.concurrent.Semaphore]]
*/
final case class PermitSem[F[_]](sem: Semaphore[F]) extends Permit[F] {
final case class PermitSemaphore[F[_]](sem: Semaphore[F]) extends Permit[F] {
def withPermit[A](fa: F[A]): F[A] = sem.withPermit(fa)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ object CE2Kernel {
override def permitOf(limit: Long): I[Permit[F]] =
makeSemaphore
.semaphore(limit)
.map(PermitSem(_))
.map(PermitSemaphore(_))
}

def boundedParallel[F[_]: Async: Parallel]: BoundedParallelCarrierCE2[F] = new BoundedParallelCarrierCE2.Impl[F] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ final case class SerialSemRef[F[_]: MonadCancelThrow, A](ref: Ref[F, A], sem: Se

/** Default implementation of [[tofu.concurrent.Permit]] that use [[cats.effect.std.Semaphore]]
*/
final case class PermitSem[F[_]: MonadCancelThrow](sem: Semaphore[F]) extends Permit[F] {
final case class PermitSemaphore[F[_]: MonadCancelThrow](sem: Semaphore[F]) extends Permit[F] {
def withPermit[A](fa: F[A]): F[A] = sem.permit.use(_ => fa)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ object CE3Kernel {
override def permitOf(limit: Long): I[Permit[F]] =
makeSemaphore
.semaphore(limit)
.map(new PermitSem[F](_))
.map(new PermitSemaphore[F](_))
}

def boundedParallel[F[_]: Concurrent: Parallel]: BoundedParallelCarrierCE3[F] =
Expand Down

0 comments on commit 94bbac7

Please sign in to comment.