ax(node): replace AddPeer prose comment with usage example
AX Principle 2: comments restate the signature — replace with a concrete call showing realistic values and the debounce behaviour as a note. Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
501d7ecf11
commit
39e0df4de3
1 changed files with 2 additions and 3 deletions
|
|
@ -232,9 +232,8 @@ func (r *PeerRegistry) ListAllowedPublicKeys() []string {
|
|||
return keys
|
||||
}
|
||||
|
||||
// AddPeer adds a new peer to the registry.
|
||||
// Note: Persistence is debounced (writes batched every 5s). Call Close() to ensure
|
||||
// all changes are flushed to disk before shutdown.
|
||||
// registry.AddPeer(&Peer{ID: "abc123", Name: "worker-1", Address: "10.0.0.2:9090", Role: RoleWorker})
|
||||
// Persistence is debounced — call Close() before shutdown to flush all pending writes.
|
||||
func (r *PeerRegistry) AddPeer(peer *Peer) error {
|
||||
r.mu.Lock()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue