The library implements a fork(fanout) and join(fanin) pattern using goroutines
- Multiplexer spawns N goroutines for N worker added through addWorker method on the Multiplexer.
- Multiplexer's model stream response from workers to client.
- Each worker needs to,
- Implement Worker interface and return on result channel. Heartbeat is managed for the worker.
- Exit its work on a signal from Multiplexer on the done channel
- Worker only need to implement the actual work.
- The worker (goroutine) is considered unhealthy if the heartbeat is delayed by more than two seconds and is restarted.