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

Refactor MessageSerializationRegister #1114

Merged
merged 3 commits into from
Jan 19, 2023

Conversation

slang25
Copy link
Member

@slang25 slang25 commented Jan 18, 2023

Initial refactor ahead of tackling more of the issues mentioned in #1112
The Lazy<T> might be overkill, but feels like the right pattern to use if we are using ConcurrentDictionary.

This change keeps a HashSet<IMessageSerializer>, which will in most cases be 1 per message format (so only ever 1, until we introduce something like the CloudEvents format), this will reduce the work to figure out the subject, then we key the TypeSerializer by the subject. It makes more sense, and gives us the ability to easily add custom subjects later.

@slang25 slang25 requested a review from a team as a code owner January 18, 2023 21:24
@codecov
Copy link

codecov bot commented Jan 18, 2023

Codecov Report

Merging #1114 (c1567c3) into main (8393e96) will increase coverage by 0.23%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1114      +/-   ##
==========================================
+ Coverage   86.06%   86.30%   +0.23%     
==========================================
  Files         137      137              
  Lines        3302     3308       +6     
==========================================
+ Hits         2842     2855      +13     
+ Misses        460      453       -7     
Flag Coverage Δ
linux 86.30% <100.00%> (+0.50%) ⬆️
macos 53.93% <100.00%> (+0.08%) ⬆️
windows 53.93% <100.00%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ssageSerialization/MessageSerializationRegister.cs 96.96% <100.00%> (+0.67%) ⬆️
...ools/MessageHandling/Dispatch/MessageDispatcher.cs 98.18% <0.00%> (+12.72%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@slang25 slang25 merged commit aa73912 into justeattakeaway:main Jan 19, 2023
@slang25 slang25 deleted the refactor-serializer-registry branch January 19, 2023 13:59
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