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

Refactor replica state & various cleanups #20

Closed danburkert closed 9 years ago

Hoverbear commented 9 years ago

I'm moving append() back to accepting Ts. Behind the scenes we'll bincode them. This is reasonable because we need to use bincode (or some other serialization format) to transmit things like SocketAddrs in the case of a redirect. I don't really see a need for exposing raw [u8] at this time.

danburkert commented 9 years ago

By keeping it as raw bytes it allows the client to specify the serialization format (e.g. capnproto). I would recommend writing a wrapper struct around the client if you want auto serialization through rustc encodable, but by making the lowest level API require it you limit flexibility for all clients.

Hoverbear commented 9 years ago

That's a good point. Let's leave it [u8] then.