You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add stream-oriented AppendEntries API for pipelined replication
Add `Raft::stream_append()` method that allows processing multiple AppendEntries
requests through a pipelined stream interface. This enables efficient batched
log replication with backpressure support via a bounded channel.
Example usage:
```rust
use std::pin::pin;
use futures::StreamExt;
let input = futures::stream::iter(vec![request1, request2, request3]);
let mut output = pin!(raft.stream_append(input));
while let Some(result) = output.next().await {
match result {
Ok(log_id) => println!("Flushed: {:?}", log_id),
Err(err) => {
println!("Error: {}", err);
break;
}
}
}
```
Changes:
- Add `Raft::stream_append()` for stream-based AppendEntries processing
- Add `StreamAppendError` with `Conflict` and `HigherVote` variants
- Add `StreamAppendResult` type alias for stream item results
- Add `AppendEntriesResponse::into_stream_result()` conversion method
- Add `ProtocolApi::stream_append()` internal implementation
- Add integration tests for success, conflict, and higher vote scenarios
0 commit comments