22 lines
689 B
Plaintext
22 lines
689 B
Plaintext
Master
|
|
boot up workers
|
|
listen for worker messages
|
|
add worker messages to message queue
|
|
process message queue
|
|
"reply" to a message allows sending a message back down to worker
|
|
|
|
When worker asks for file but no files left, send shutdown message to worker
|
|
when worker connection breaks, end thread
|
|
wait on all threads
|
|
when all threads are done, all workers must be done
|
|
|
|
|
|
|
|
when a runner asks for file but master responds with shutdown, mark self
|
|
as terminated, shut down runners. Any runner that asks for a file is
|
|
auto-terminated
|
|
wait for runner threads to finish
|
|
then exit, breaking master connection
|
|
|
|
Test individual messages? Ensure they handle the right method? May not be worth it.
|