-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
chore(p2p_service): clean up processing of p2p req/res protocol #2124
Merged
Merged
Changes from 2 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
f7e193a
chore(p2p_service): clean up processing of p2p req/res protocol
rymnc ed3ca32
fix: changelog
rymnc 3aa1779
fix: clippy
rymnc 6b5a078
fix: make closure cleaner
rymnc a62694e
fix: make the outputs of P2pDb trait the same fmt
rymnc e52bffc
chore: use generics for response_sender and task_request in handle_re…
rymnc aa16f77
Merge branch 'master' into fix/large-match-arms-in-p2p-processing
rymnc 4dc2931
fix: fmt
rymnc 7303671
chore: add omitted comment
rymnc 8910fb6
Merge branch 'master' into fix/large-match-arms-in-p2p-processing
rymnc c869a66
Removed `into_iter`
xgreenx fb67a77
Merge remote-tracking branch 'origin/fix/large-match-arms-in-p2p-proc…
xgreenx 7c21289
Merge branch 'master' into fix/large-match-arms-in-p2p-processing
rymnc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
here I preferred using fn pointers for the
response_sender
,task_request
instead of trait methods onRequestMessage
to reduce verbosity of the code. Happy to implement it that way if the team prefers it.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'm happy with taking functions as arguments, although since there are three related functions here, grouping them together in a trait might make the code even nicer to read.
One question though,
response_sender
andtask_request
are both function pointers whereasdb_lookup
is aFnOnce
-generic. I think the code would read better if we used generics for all three arguments. This would make the function more flexible for future extensions as well.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.
addressed in e52bffc, thanks
cc: @AurelienFT