kafka_ex icon indicating copy to clipboard operation
kafka_ex copied to clipboard

What are the success and failure responses for KafkaEx.publish/2

Open BenMorganIO opened this issue 7 years ago • 1 comments

Hey guys,

I noticed while using the library that there's many responses that KafkaEx.publish/2 may produce. Namely:

nil
:ok
{:ok, integer}
{:error, :closed}
{:error, :inet.posix}
{:error, any}
iodata
:leader_not_available

Would it be possible to make it more uniform so that it is:

{:ok, integer | iodata | nil}
{:error, nil | :closed | :inet.posix | :leader_not_available | any}

This would make building robust applications with KafkaEx for easier. Also, I don't think we need an any() in the {:error, _} if we're already defining different types.

BenMorganIO avatar Oct 25 '18 17:10 BenMorganIO

Somehow I missed this one. I'm fine with doing that - in general any cleanup along those lines is nice.

joshuawscott avatar Dec 07 '18 17:12 joshuawscott