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

Thoughts for decoupling & abstracting away from the event loop? #87

Open WildCryptoFox opened 8 years ago

WildCryptoFox commented 8 years ago

What I'm proposing is to split the MIO specifics out of the Raft core. Specifically to make sure that the Raft implementation doesn't contain opinionated and possibly consumer blocking constraints such as being limited to Raft owning the event loop, and working only on TCP. Additionally this simplifies the testing suite such that the tests are Raft specific.

Hoverbear commented 8 years ago

I like the points you bring up and I think that this is a discussion we should involve @danburkert as well, let's wait to talk about it till he's back?

WildCryptoFox commented 8 years ago

Definitely - already intended to wait for his thoughts. We have already all mentioned and discussed the idea of breaking things into the respective modules a while back on IRC. Thought considering I've implemented it for my own projects; that it should be an issue here for when/if we eventually do abstract the implementation specifics away. :-)

cramertj commented 8 years ago

Has any progress been made on this? I'm interested in contributing if possible. I'm relatively new to Rust, but it seems like an extra hand may be of use here.

danburkert commented 8 years ago

@cramertj not much movement. The library is already split internally into the Consensus and Server types internally. Consensus is responsible for all of the Raft logic, while Server handles sending/receiving messages between peers and clients. The separation is pretty good, but there is probably room for improvements. If you have any ideas they would be appreciated!

Albibek commented 6 years ago

Hi everyone. I've managed to separate the consensus logic of this crate to a separate crate. https://github.com/Albibek/raft-consensus

Feel free to criticise, submit PRs, issues, etc.

Hoverbear commented 6 years ago

Hi @Albibek Awesome! 🎉 :)

Over at @pingcap we also created https://github.com/pingcap/raft-rs with the Raft implementation in production with TiKV. I'm going to be focusing my efforts there.