Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
BenMorganIO opened this issue Oct 25, 2018 · 1 comment
Open

Comments

@BenMorganIO
Copy link

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.

@joshuawscott
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants