Add withMetrics1 method for partial binary compatibility #372
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation:
In an intermediate version 15.2.0 there were two methods for creating a metered producer:
withMetrics
usingMeasureDuration
fromsmetrics
withMetrics1
usingMeasureDuration
fromcats-helper
There's only one
withMetrics
method now, usingMeasureDuration
from cats-helper.The same goes for consumer: https://github.com/evolution-gaming/skafka/blob/v15.2.0/skafka/src/main/scala/com/evolutiongaming/skafka/consumer/Consumer.scala#L955-L969
If library
A
depends onv15.2.0
and callswithMetrics1(catshelper.MeasureDuration)
, and libraryB
depends onA
but evictsskafka
to16.0.0
, thenB
callsA
,A
callswithMetrics1(catshelper.MeasureDuration)
, but there's no such method inskafka
v16.0.0
(the only one present iswithMetrics(catshelper.MeasureDuration)
), so it fails with a runtime error.This PR tries to fix that, at least partially.