skafka
skafka copied to clipboard
consumer.offsetsForTimes - consider using Instant as query types instead of Offset
Currently it's defined as
def offsetsForTimes(timestampsToSearch: Map[TopicPartition, Offset]): F[Map[TopicPartition, Option[OffsetAndTimestamp]]]
while working on #122 we agreed with @t3hnar to have following method def for new RebalanceCallback API
def offsetsForTimes[F[_]](
timestampsToSearch: Nem[TopicPartition, Instant]
): RebalanceCallback[F, Map[TopicPartition, Option[OffsetAndTimestamp]]]
The diff is
- usage of
Instantinstead ofOffset - usage of
NonEmptyMapinstead of regular scalaMap(which can be empty)
The same can be applied to corresponding Consumer methods
- offsetsForTimes
- offsetsForTimes with timeout