-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Add
RaftTypeConfig::Responder
to customize returning clien…
…t write response This commit introduces the `Responder` trait that defines the mechanism by which `RaftCore` sends responses back to the client after processing write requests. Applications can now customize response handling by implementing their own version of the `RaftTypeConfig::Responder` trait. The `Responder::from_app_data(RaftTypeConfig::D)` method is invoked to create a new `Responder` instance when a client write request is received. Once the write operation is completed within `RaftCore`, `Responder::send(WriteResult)` is called to dispatch the result back to the client. By default, `RaftTypeConfig::Responder` retains the existing functionality using a oneshot channel, ensuring backward compatibility. This change is non-breaking, requiring no modifications to existing applications. - Fix: #1068
- Loading branch information
1 parent
e4fed70
commit 3b18517
Showing
16 changed files
with
444 additions
and
228 deletions.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
//! Collection of implementations of usually used traits defined by Openraft | ||
|
||
pub use crate::async_runtime::TokioRuntime; | ||
pub use crate::entry::Entry; | ||
pub use crate::node::BasicNode; | ||
pub use crate::node::EmptyNode; | ||
pub use crate::raft::responder::impls::OneshotResponder; |
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.