kafka_ex
kafka_ex copied to clipboard
What are the success and failure responses for KafkaEx.publish/2
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.
Somehow I missed this one. I'm fine with doing that - in general any cleanup along those lines is nice.