Since responses may arrive out of order relative to requests, demultiplex as follows.
| Rule | Detail |
|---|---|
| Matching key | The echoed (op, key). A/T match against an A waiter; R/N match against an R waiter |
| Multiple requests with the same (op, key) | Matched in the order sent (a FIFO queue per (op, key)) |
| Registration timing | The waiter is registered before the request is sent (to prevent a race where the response arrives first) |
Handling N/T | Returned as non-error values ("didn't exist" / "timed out") |
E / unknown response | Log and ignore (connection kept alive). not_active switches that connection to another node |