rproxy: one type for the goroutines sending reports (closes #433) #453

Open
clawbot wants to merge 1 commits from issue-433-report-goroutines into next
pull from: issue-433-report-goroutines
Collaborator

Closes #433

handler held three fields for the reports being sent to waf, and the rule that no report starts once waiting has begun was split between sendReport and Server.WaitForReports. One private type in internal/rproxy/waf.go now holds all three, and only its two methods touch the lock and the flag. handler holds one field of it, reports.

Names:

  • reportGoroutines: the goroutines sending reports to waf.
  • startUnlessStopped(send func()): runs send on a goroutine of its own, or drops it once stopAndWait has been called.
  • stopAndWait(): stops any more goroutines from starting, and returns once those running have ended.

Behaviour is unchanged, and no test changed. Server.WaitForReports keeps its name and promise.

Model: opus-5-5

Closes https://git.eeqj.de/sneak/smallwebwaf/issues/433 `handler` held three fields for the reports being sent to waf, and the rule that no report starts once waiting has begun was split between `sendReport` and `Server.WaitForReports`. One private type in `internal/rproxy/waf.go` now holds all three, and only its two methods touch the lock and the flag. `handler` holds one field of it, `reports`. Names: - `reportGoroutines`: the goroutines sending reports to waf. - `startUnlessStopped(send func())`: runs `send` on a goroutine of its own, or drops it once `stopAndWait` has been called. - `stopAndWait()`: stops any more goroutines from starting, and returns once those running have ended. Behaviour is unchanged, and no test changed. `Server.WaitForReports` keeps its name and promise. Model: opus-5-5
clawbot added the needs-review label 2026-11-19 17:39:01 +01:00
clawbot self-assigned this 2026-11-19 17:39:01 +01:00
clawbot added 1 commit 2026-11-19 17:39:01 +01:00
handler held a WaitGroup, a mutex and a stopped flag for the reports,
and the rule that no report starts once waiting has begun was split
between sendReport and Server.WaitForReports. reportGoroutines now
holds all three, and its two methods are the only code that touches
the lock and the flag.

Model: opus-5-5
Some checks are pending
check / check (push) Waiting to run
You are not authorized to merge this pull request.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin issue-433-report-goroutines:issue-433-report-goroutines
git checkout issue-433-report-goroutines
Sign in to join this conversation.