Hoverbear / old-raft-rs

[Incomplete] A Raft implementation in Rust
https://hoverbear.github.io/raft-rs/raft/
MIT License
266 stars 41 forks source link

WIP: refactor Server and Replica #31

Closed danburkert closed 9 years ago

danburkert commented 9 years ago

@Hoverbear as we discussed in #30, the way the Server and Replica are structured right now makes it very hard to return responses back to clients. With this in mind I've been refactoring the responsibilities of each. A lot of this is inspired by etcd's architecture, described here.

This is a work in progress, right now I've replaced EmitType with an Actions struct which is much more flexible with what the Replica expects the Server to do. This also makes it significantly easier to implement Server. Eventually I would like the Server to control the StateMachine and Store instance as well. Right now I've broken some things that previously 'worked', so I don't want to merge this now. Definitely interested in feedback in the way this is heading.

Hoverbear commented 9 years ago

Looks good, @danburkert! I really like this direction and like the messages abstractions.

Hoverbear commented 9 years ago

As we discussed I'm merging this!