Skip to content

Instantly share code, notes, and snippets.

@jchapuis
Created August 12, 2024 09:56
Show Gist options
  • Save jchapuis/77c2b671b71195d6817dfc550c645567 to your computer and use it in GitHub Desktop.
Save jchapuis/77c2b671b71195d6817dfc550c645567 to your computer and use it in GitHub Desktop.
Lease repository abstraction
trait LeaseRepository[F[_]]:
def labels: List[Label]
def acquire(id: LeaseID, holderID: HolderID, annotations: List[Annotation] = Nil)(implicit
parameters: LeaseParameters = LeaseParameters.Default
): Resource[F, HeldLease[F]]
def get(id: LeaseID): F[Option[Lease[F]]]
def list: F[List[Lease[F]]]
def watcher: fs2.Stream[F, LeaseEvent[F]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment