pd: use tokio_util::sync::PollSender
in consensus svc
#436
+15
−53
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.
In v0.7 of
tokio-util
, thePollSender
API was changed to have thesemantics that most users expect (see tokio-rs/tokio#4214). The
poll_send_done
method was replaced with apoll_reserve
method, andthe implementation rewritten to drive a
Sender::reserve_owned
futurethat's consumed in
send_item
. Now,PollSender
essentially implementsexactly the same code that was written by hand in the consensus service.
We can simplify the consensus service significantly by upgrading the
tokio-util
dependency to 0.7 and replacing the hand-written versionwith
PollSender
.There should be no functional change as a result of this refactor.