-
Notifications
You must be signed in to change notification settings - Fork 20
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
API change proposal #89
Comments
I realised yesterday that it is possible to have subscriptions for multiple event types. I am not sure that this allows for different kinds of events. Maybe it makes sense to keep the old API and just add convenience methods on top for the 99% case of always the same event type. |
@i-am-the-slime Api extension even better. For backward compatibility for example. |
Sorry for the late response guys, I missed my github notifications I am definitely up for making a release of Kanadi that fixes the API, there are quite a few historical mistakes. @i-am-the-slime has a point though, you can technically subscribe to multiple event types which have different structures (i.e. undefined vs data vs business) The only issue is that I am currently maintaining 3 branches (yay for binary compatibility!) so I need to think about how to approach this. |
@vitold But yeah, a PR to add an extra method for this case is always welcome, that way its backwards compatible! |
As a part of a new project, we are considering to use kanadi as a driver for streaming from nakadi.
Going through the source code I found some inconvenient parts which put some low-level responsibility on the client:
1)
I suggest to refactor it to:
The reason for this is the api of nakadi do not allow you to have several message types in the same event type, so this pattern matching becomes an unnecessary boilerplate every time when you creating the event batch handler.
2)
Change the type of SubscriptionEvent.events from
Option[List[Event[T]]]
toNonEmptyList[Event[T]]
As a user of the driver, you do not expect to receive an empty batch. And in case of an error, it should be reported internally in the driver.
The text was updated successfully, but these errors were encountered: