T1: the seat settle applies a delayed nak with the bus's own delay (ADR 0664 §1, issue 1748)
Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
@@ -1256,8 +1256,10 @@ type seatAsked struct {
|
||||
Bucket string `json:"bucket"`
|
||||
Key string `json:"key"`
|
||||
// WaitMS is how long a pull waits for a message (none when 0); Fate what a settle gives one (issue 1887 A11).
|
||||
WaitMS int `json:"wait_ms"`
|
||||
Fate string `json:"fate"`
|
||||
WaitMS int `json:"wait_ms"`
|
||||
// DelayMS is how long a settle with the fate nak-after waits before the bus gives the message again.
|
||||
DelayMS int64 `json:"delay_ms"`
|
||||
Fate string `json:"fate"`
|
||||
}
|
||||
|
||||
// Seat answers a bundle's seat traffic, each as the module and only as far as its membership lists:
|
||||
@@ -1300,7 +1302,13 @@ func (b *moduleBus) Seat(verb string, params json.RawMessage, handOn func(string
|
||||
}
|
||||
return json.Marshal(p)
|
||||
case "settle":
|
||||
if err := conn.SeatSettle(b.module, asked.ID, asked.Fate); err != nil {
|
||||
settle := func() error { return conn.SeatSettle(b.module, asked.ID, asked.Fate) }
|
||||
if asked.Fate == bus.SettleNakAfter {
|
||||
settle = func() error {
|
||||
return conn.SeatSettleAfter(b.module, asked.ID, time.Duration(asked.DelayMS)*time.Millisecond)
|
||||
}
|
||||
}
|
||||
if err := settle(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.RawMessage(`{}`), nil
|
||||
|
||||
Reference in New Issue
Block a user