Learned that you can split a library up into several libraries that depend on each other (not cyclically though)
Learned that while doing this, you can still have top-level exposed values so that if you have a library, say node which exposes a module Node, you can have sub-modules such as Node.Server as well as top-level values such as Node.init
After learning this, I decided to:
Split the entire codebase into two libraries: common and node.
common is for things like the Tqueue module, the Address module, etc. Modules that define types of data and operations on them that must be accessible from any library in Pollinate.
node is where anything only needed by the former client module goes.
A node is what used to be called a client.
It has a client-part and a server-part, and both of these parts have their own module under the Node module.
The client is responsible for sending and receiving messages to-and-from other nodes.
The server is responsible for handling incoming messages asynchronously.
Separate failure detector back out into its own file, yay :smile:
Okay... Is Anything Broken?
Nope :smile: this was a successful refactor. Everything still works, tests still pass.
How Much of a Pain Will This Be to Review?
The nature of review is that you kind of have to comb through everything that changed and make sure that nothing slipped by the author of the PR. I don't want to impose this on you, and since things work and this is just a refactoring, I don't think this needs as serious review as other PRs might. No functionality has changed, so I would say: review this for the sake of understanding/critiquing the new architecture, don't feel obligated to search for small issues that I may have missed. Nothing wrong with making commits to fix those issues in the future. If you find them anyway, thanks! Please let me know, no harm in fixing them now either, but it's just not the priority since we have much more to do.
What Did You Do ???
I ...
node
which exposes a moduleNode
, you can have sub-modules such asNode.Server
as well as top-level values such asNode.init
After learning this, I decided to:
common
andnode
.common
is for things like theTqueue
module, theAddress
module, etc. Modules that define types of data and operations on them that must be accessible from any library in Pollinate.node
is where anything only needed by the formerclient
module goes.node
is what used to be called a client.Node
module.Okay... Is Anything Broken?
Nope :smile: this was a successful refactor. Everything still works, tests still pass.
How Much of a Pain Will This Be to Review?
The nature of review is that you kind of have to comb through everything that changed and make sure that nothing slipped by the author of the PR. I don't want to impose this on you, and since things work and this is just a refactoring, I don't think this needs as serious review as other PRs might. No functionality has changed, so I would say: review this for the sake of understanding/critiquing the new architecture, don't feel obligated to search for small issues that I may have missed. Nothing wrong with making commits to fix those issues in the future. If you find them anyway, thanks! Please let me know, no harm in fixing them now either, but it's just not the priority since we have much more to do.
Closes #26