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

Consider alternative EventStream implementation #143

Open
mattfbacon opened this issue Jan 14, 2024 · 4 comments
Open

Consider alternative EventStream implementation #143

mattfbacon opened this issue Jan 14, 2024 · 4 comments

Comments

@mattfbacon
Copy link

For a lot of drivers, grouping of events matters. The current EventStream implementation doesn't expose their grouping so it is difficult to properly implement functionalities using such devices if you also want to be async.

I have implemented an alternative API based on the same FetchEventsSynced struct used by the sync event interface. mattfbacon@7660fe9

I think this makes more sense because it provides flexibility based on the grouping. e.g., users can adapt it to a Stream by flattening the event groups, or process each chunk directly when it matters.

@emberian
Copy link
Owner

hm, this is a major problem...

@mattfbacon
Copy link
Author

I agree, hence my fork. What are your thoughts on those changes?

@coolreader18
Copy link
Collaborator

How would you feel about being able to opt in to that? Like, a separate next_event_batch function that returns FetchEventsSynced? I think it should be possible to have both; maybe range and consumed_to would be redundant but otherwise it should be possible.

@mattfbacon
Copy link
Author

It's a possibility but I don't think it's really necessary because the unbatched version can be synthesized from the batched version, but not vice versa.

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

3 participants