com.evolutiongaming.kafka.journal.RandomIdOf.scala Maven / Gradle / Ivy
The newest version!
package com.evolutiongaming.kafka.journal
import java.util.UUID
import cats.effect.Sync
trait RandomIdOf[F[_]] {
def apply: F[RandomId]
}
object RandomIdOf {
def apply[F[_]](implicit F: RandomIdOf[F]): RandomIdOf[F] = F
def uuid[F[_] : Sync]: RandomIdOf[F] = new RandomIdOf[F] {
def apply = Sync[F].delay { RandomId(UUID.randomUUID().toString) }
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy