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

ServerSnapshot: Improve API and allow filtering with custom struct enumerator #2337

Merged
merged 5 commits into from
Jan 4, 2023

Conversation

mgravell
Copy link
Collaborator

@mgravell mgravell commented Jan 3, 2023

so we aren't limited just to ReadOnlySpan<ServerEndpoint>, and don't need the allocatey ToArray()

implemented as custom iterator which allows async and LINQ to work directly' existing code still uses span for efficiency, with the new API used in limited scenarios only

intent here:

  1. provide an efficient basis for filtered "all server's matching X" functionality
  2. provide the Where(CommandFlags) basis for upcoming broadcast work
  3. avoid some unnecessary allocations

@mgravell mgravell marked this pull request as ready for review January 4, 2023 09:37
Copy link
Collaborator

@NickCraver NickCraver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks awesome - no notes, much cleaner and dig the implementation. Good call going this route!

@NickCraver NickCraver changed the title better API support on ServerSnapshot ServerSnapshot: Improve API and allow filtering with custom struct enumerator Jan 4, 2023
@NickCraver NickCraver merged commit c4e5453 into main Jan 4, 2023
@NickCraver NickCraver deleted the marc/server-snapshot-fun branch January 4, 2023 13:59
@NickCraver NickCraver mentioned this pull request Jan 4, 2023
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

Successfully merging this pull request may close these issues.

2 participants