distribution steps its windows with mesh-delivery's sdk window package (B5g; ADR 0634 §1; issue 1966)

Claude-Session: https://claude.ai/code/session_01NcbgfFSnn24M3GcqttoU7i
This commit is contained in:
2026-11-05 16:09:37 +01:00
parent b8642c8b27
commit 85999b7efd
@@ -3,7 +3,7 @@ package holder
import (
"fmt"
"git.novox.be/novox/mesh-sdk/go/delivery"
"git.novox.be/novox/mesh-delivery/sdk/window"
"slices"
"sort"
"time"
@@ -29,11 +29,11 @@ const (
)
// Window is one window's record, kept in distribution's state windows: what registry_old_name and
// registry_direct_writes answer. Its open, holding, since, closed and last holding are mesh-sdk's delivery.WindowHeld,
// the part every window keeper shares and steps by one rule (delivery.StepWindow).
// registry_direct_writes answer. Its open, holding, since, closed and last holding are mesh-delivery's sdk/window.WindowHeld,
// the part every window keeper shares and steps by one rule (window.StepWindow).
type Window struct {
Name string `json:"name"`
delivery.WindowHeld
window.WindowHeld
Dropped []DroppedNode `json:"dropped,omitempty"`
// Why says, of each node holding the window, why it holds it: what its read answered, a node-engine whose
// manifest-reads did not answer (an away node, an older node-engine, a timeout) included, so a timeout taken as
@@ -134,7 +134,7 @@ func isDropped(dropped []DroppedNode, node string) bool {
return slices.ContainsFunc(dropped, func(d DroppedNode) bool { return d.Node == node })
}
// Step moves the window by mesh-sdk's one rule (delivery.StepWindow): named is every node the read named, dropped ones
// Step moves the window by mesh-sdk's one rule (window.StepWindow): named is every node the read named, dropped ones
// included, holding those holding the window at now. A read naming no node judges nothing. It answers the next record,
// the closing event when it closed in this step (said once), and the nodes holding it past WindowFindingAfter (the
// finding; cleared when it closes). A window once closed stays closed: a node that holds it later is no reason to serve
@@ -144,7 +144,7 @@ func (w Window) Step(named, holding []string, now time.Time) (next Window, close
if !w.Open && !w.Closed.IsZero() {
return next, nil, nil
}
held, shut, overdue := delivery.StepWindow(w.WindowHeld, named, holding, now, WindowFindingAfter)
held, shut, overdue := window.StepWindow(w.WindowHeld, named, holding, now, WindowFindingAfter)
next.WindowHeld = held
if !held.Open {
next.Why = nil