-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat: add an topic event enumerable #575
Conversation
Introduces an interface `ITopicEvent` which covers both system events (`TopicEvent`) and normal messages (`TopicMessage`). We refactor the internals of the stream to be over `ITopicEvent`s, so that we can filter to just `TopicMessage` (as is implemented currently) or pass through all events in an event enumerable (to come in a future commit).
Opening for early review for opinions on naming and organization. Currently the subscription response object has a To organize this we've introduced an interface |
'event' feels like 'a thing that happened' to me. I like it for |
There was a thread in slack when we did this work for golang, and Event is the name that most people settled on, so as far as the public API for this goes I think we should be trying to mirror (semantically) what we did in go. I think it probably makes sense for the parent type / interface to include the word Event even though I do agree there is a bit of ambiguity for normal messages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think i'm good with the names so far.
might be good to get @anitarua to weigh in since she did the prev two.
Yeah, I think the names are fine here, In the Go SDK, |
Previously the subscription stream pruned heartbeats and discontinuities before reaching the subscription response subscription. Since we will consume heartbeats and discontinuities in the event enumerable, we pass these through and ignore in the message enumerator.
Given the consensus, I've left the names as is. As Anita pointed out, there's a difference in naming vs the Golang SDK. In the protos we have |
Adds an async enumerator over all events, not just messages. This largely parallels the existing enumerator over messages only. See the integration tests for an example usage. Call `WithCancellationForAllEvents` to get the enumerator.
Introduces an interface
ITopicEvent
which covers both normalmessages (
TopicMessage
) and system events (TopicSystemEvent
). Werefactor the internals of the stream to be over
ITopicEvent
s, sothat we can filter to just
TopicMessage
(as is implementedcurrently) or pass through all events in an event enumerable.
To enumerate over all events in the stream, call
GetAllEventsAsyncEnumerable
,or
WithCancellationForAllEvents
.This largely parallels the existing enumerator over messages only. See the
integration tests for an example usage.