From e2ab0160a9ae70ea96989c336535267674505ea3 Mon Sep 17 00:00:00 2001 From: Z1kkurat Date: Thu, 24 Aug 2023 15:51:30 +0200 Subject: [PATCH] Add ProducerOf.apply2/ConsumerOf.apply2 for binary compatibility --- .../evolutiongaming/skafka/consumer/ConsumerOf.scala | 11 +++++++++++ .../evolutiongaming/skafka/producer/ProducerOf.scala | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/skafka/src/main/scala/com/evolutiongaming/skafka/consumer/ConsumerOf.scala b/skafka/src/main/scala/com/evolutiongaming/skafka/consumer/ConsumerOf.scala index 756f1ca7..730dabde 100644 --- a/skafka/src/main/scala/com/evolutiongaming/skafka/consumer/ConsumerOf.scala +++ b/skafka/src/main/scala/com/evolutiongaming/skafka/consumer/ConsumerOf.scala @@ -51,6 +51,17 @@ object ConsumerOf { } } + /** The sole purpose of this method is to support binary compatibility with an intermediate + * version (namely, 11.15.1) which had `apply1` method using `MeasureDuration` from `smetrics` + * and `apply2` using `MeasureDuration` from `cats-helper`. + * This should not be used and should be removed in a reasonable amount of time. + */ + @deprecated("Use `apply1`", since = "11.16.3") + def apply2[F[_] : Concurrent : ContextShift : ToTry : ToFuture : MeasureDuration : Clock]( + executorBlocking: ExecutionContext, + metrics: Option[ConsumerMetrics[F]] = None + ): ConsumerOf[F] = apply1(executorBlocking, metrics) + implicit class ConsumerOfOps[F[_]](val self: ConsumerOf[F]) extends AnyVal { def mapK[G[_]: Applicative: Defer]( diff --git a/skafka/src/main/scala/com/evolutiongaming/skafka/producer/ProducerOf.scala b/skafka/src/main/scala/com/evolutiongaming/skafka/producer/ProducerOf.scala index 040fa3d2..518d6032 100644 --- a/skafka/src/main/scala/com/evolutiongaming/skafka/producer/ProducerOf.scala +++ b/skafka/src/main/scala/com/evolutiongaming/skafka/producer/ProducerOf.scala @@ -42,6 +42,17 @@ object ProducerOf { } } + /** The sole purpose of this method is to support binary compatibility with an intermediate + * version (namely, 11.15.1) which had `apply1` method using `MeasureDuration` from `smetrics` + * and `apply2` using `MeasureDuration` from `cats-helper`. + * This should not be used and should be removed in a reasonable amount of time. + */ + @deprecated("Use `apply1`", since = "11.16.3") + def apply2[F[_]: Concurrent: ContextShift: MeasureDuration: ToTry]( + executorBlocking: ExecutionContext, + metrics: Option[ProducerMetrics[F]] = None + ): ProducerOf[F] = apply1(executorBlocking, metrics) + implicit class ProducerOfOps[F[_]](val self: ProducerOf[F]) extends AnyVal { def mapK[G[_]: Monad: Defer](