Comments (3)
You'd want unquote(__CALLER__.module)
rather than unquote(__MODULE__)
, and you don't want to expand the call to node()
, but that wasn't your question :P
I'm not sure I follow on the set_configuration
bit, are you saying it would be a macro which expands to something effectively like Raft.really_set_configuration(leader, [{KVStore, :"a@mymachine"}, ...])
?
It might instead make more sense to have set_configuration
take 3 arguments, the leader, the Raft module (i.e. KVStore
in your example), and then the node list, and internally apply the Raft module to each element of the node list. This would be equivalent to saying "build a Raft cluster with members named KVStore
running on nodes A, B, and C". Then you take care of joining the name with the node to form the tuple for communicating with those processes. Since the Raft module is a key part of the API, I'm not sure hiding it will always be viable, it is probably desirable to make things explicit, but make the API convenient enough, that you don't have to do something like wrap every node name in a tuple with the Raft module. Things get tricky though if you want to support some kind of process registry using {:via, registry, name}
, because then you need to explicitly provide those tuples as elements of the list; but you could support a hybrid list, where plain atoms are paired with the module name to get the {name, node}
pair, and anything else is treated as-is, so that you could either use the convenient API, or provide a list of via tuples if that's what you need. It still feels less than perfect, but I'm mostly spitballing ideas here.
I don't yet have a strong opinion on this though until I have a chance to do some experimentation, but just conceptually this is my two cents, hope that is the feedback you were looking for :)
from raft.
Stepping back, the whole reason I wanted to consider this was to make it easier to specify clusters, add new peers, etc. I'm not sure that this implementation is going to really satisfy that goal in the best way. Its probably better to see how #4 pans out and then evaluate after that.
from raft.
Closing this for now because I think this issue will be mitigated in #4.
from raft.
Related Issues (11)
- Support partisan for distribution and messaging HOT 2
- Followers aren't using higher terms from request vote rpcs
- Supervise RPC calls
- vs. rabbitmq/ra HOT 1
- Question: Is raft a good fit for just managing leadership? HOT 1
- In memory backend. HOT 9
- Terms don't match in node shutdown test
- Random test failure: "Somehow we have more logs then commands" HOT 1
- Cluster membership changes HOT 6
- What to do with invalid messages? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from raft.