Documentation
¶
Overview ¶
Package p2c implements a power-of-two-choices selector with time-decayed EWMA latency and success tracking, inspired by go-zero's p2c_ewma. Each pick samples two nodes and selects the one with the lower estimated load; the DoneFunc feeds observed latency/errors back into the node's EWMA. Nodes with a high failure rate are deprioritized, and stale nodes not picked recently are force-picked so a newly healthy node is not starved.
Click to show internal directories.
Click to hide internal directories.