haskell-works / hw-kafka-client

Kafka client for Haskell, including auto-rebalancing consumers
MIT License
139 stars 50 forks source link

Use ByteString instead of String for stats callback #159

Closed phile314 closed 3 years ago

phile314 commented 3 years ago

This avoids the round-trip via String if one wants to pass the statistics JSON to aeson for further parsing.

Note that aeson has no decoding function accepting String nor Text, but only accepts ByteStrings.

See also #158

phile314 commented 3 years ago

I have applied your comments, thanks.

Regarding the statistics type, I think without the FromJSON instances they are not terribly useful. And if we want FromJSON instances, hw-kafka-client will incur a dependency on aeson. Not that I have a problem with that, but it will increase the dependency footprint of hw-kafka-client. Though granted, for production systems one is likely to depend on Aeson for other reasons anyway.

AlexeyRaga commented 3 years ago

LGTM, perhaps would require bumping a major version since switching to ByteString is a breaking change

phile314 commented 3 years ago

I agree, bumping the major version is probably the right thing to do.