Skip to content

v0.9.5

Compare
Choose a tag to compare
@drmingdrmer drmingdrmer released this 09 Apr 06:32
· 175 commits to main since this release

Summary:

  • Added:
    • e4fed706 Add Raft::is_initialized().
    • 3b18517a Add RaftTypeConfig::Responder to customize returning client write response.
    • c508a354 Raft::client_write_ff() ff for fire-and-forget.

Detail:

Added:

  • Added: e4fed706 Add Raft::is_initialized(); by 张炎泼; 2024-04-08

    Raft::is_initialized() returns true if this raft node is already
    initialized with Raft::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-03

    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.

  • Added: c508a354 Raft::client_write_ff() ff for fire-and-forget; by 张炎泼; 2024-04-08

    Raft<C>::client_write_ff() -> C::Responder::Receiver submit a client
    request to Raft to update the state machine, returns an application
    defined response receiver Responder::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 the Responder::Receiver.

Full Changelog: v0.9.4...v0.9.5