v0.9.5
Summary:
- Added:
Detail:
Added:
-
Added: e4fed706 Add
Raft::is_initialized()
; by 张炎泼; 2024-04-08Raft::is_initialized()
returnstrue
if this raft node is already
initialized withRaft::initialize()
, by checking if log is empty and
vote
is not written. -
Added: 3b18517a Add
RaftTypeConfig::Responder
to customize returning client write response; by 张炎泼; 2024-04-03This commit introduces the
Responder
trait that defines the mechanism
by whichRaftCore
sends responses back to the client after processing
write requests. Applications can now customize response handling by
implementing their own version of theRaftTypeConfig::Responder
trait.The
Responder::from_app_data(RaftTypeConfig::D)
method is invoked to
create a newResponder
instance when a client write request is
received.
Once the write operation is completed withinRaftCore
,
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
-
Added: c508a354
Raft::client_write_ff()
ff for fire-and-forget; by 张炎泼; 2024-04-08Raft<C>::client_write_ff() -> C::Responder::Receiver
submit a client
request to Raft to update the state machine, returns an application
defined response receiverResponder::Receiver
to receive the response._ff
means fire and forget.It is same as [
Raft::client_write
] but does not wait for the response.
When using this method, it is the application's responsibility for
defining mechanism building and consuming theResponder::Receiver
.- Part of #1068
Full Changelog: v0.9.4...v0.9.5