Manager.handle_waiting
- Manager.handle_waiting(conn, new_idle_count, read_receipt)
Record that an employee is idle with nothing to do.
There is a race condition that is corrected here. If an employee sends a waiting message at the same time that its boss sends it a task, the boss’s idle count will eventually be incorrect. To fix this, every waiting message sent by an employee is accompanied by a read receipt of the latest batch of tasks it has processed. The boss can then adjust the idle count by the number of tasks sent since the read receipt.
- Return type:
None