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

Use consumers for serde state management #31

Merged
merged 1 commit into from
Apr 13, 2024

Conversation

mtdowling
Copy link
Member

This is a partial revert of the last commit. The goal there was to consolidate the logic to serialize a structure, but it ended up making struct serialization different from list and map, and it also introduced the need to manage struct state to ensure they're closed. By using only the consumer based API, there is a clear hook for before, during, and after that removes the need for state management. It also does not have any measurable performance impact to use the consumer API. Another benefit is that now StructSerializer can be a FunctionalInterface.

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

This is a partial revert of the last commit. The goal there was to
consolidate the logic to serialize a structure, but it ended up making
struct serialization different from list and map, and it also
introduced the need to manage struct state to ensure they're closed.
By using only the consumer based API, there is a clear hook for
before, during, and after that removes the need for state management.
It also does not have any measurable performance impact to use the
consumer API. Another benefit is that now StructSerializer can
be a FunctionalInterface.
@mtdowling mtdowling merged commit 8b2a00e into main Apr 13, 2024
3 checks passed
@mtdowling mtdowling deleted the consumer-serde-state-management branch April 15, 2024 23:20
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.

1 participant