This is a file syncer acrross multiple linux machines. It is a distributed system design, and there is no limit to how many machines can join the network.
cooler_dropbox.py [-h] [--init_network] [--load] shared_folder server_port client_port
positional arguments:
shared_folder
relative path of shared folder
server_port
port that listens for request
client_port
port that broadcast changes
optional arguments:
-h, --help
show this help message and exit
--init_network
starts network
--load
loads meta file, otherwise init meta file
The architecture of the program was designed by Ruben Bramasco. https://github.com/Rv-ben
The design relies heavily on having a single worker thread in which all incoming/outgoing communication passes through. The worker thread is responsible in deciding which file the node needs, whether or not it needs to store an incoming file, where to store an incoming file, sending files to other nodes, etc. Every decision of the overall node is made by the worker thread, including which nodes are allowed to join the network.
The server thread is responsible for recieving request/files and forwarding them to the worker thread via a buffer in the form of a Queue.
The watcher thread is responsible for watching file changes on the repository and forwarding those updates to the worker thread. Where the worker thread will decide whether or not it needs to propagate the updates throughout the network.