Scatter / Gather (4 of 4)
- Have gather/1 run as a separate process
- scatter/0 launches the new gather process
- scatter/3 runs as only function
- The extra param is used to send the result to the beginning process
- Need processes linked, trap_exit, timeout and count decrementing
- When it completes the scatter/0 process is notified via a message
- The gather/1 process terminates, eliminating the message queue
- Any remnant linked worker processes are also killed
- No extraneous messages clogging the queue of the main process
- Follows the original recommendation: one receive per process
- May be more complicated than needed depending on process lifetimes