add streaming API distinct from Exchange

This commit is contained in:
Patricio Whittingslow
2026-07-26 12:18:52 -03:00
parent 6d88506541
commit 92cf46e570
5 changed files with 129 additions and 10 deletions
+3 -1
View File
@@ -296,7 +296,9 @@ func TestRouterSplitRequest(t *testing.T) {
func staticPage(t *testing.T, page string) HandlerFunc {
return func(ex *Exchange) {
n, err := io.WriteString(ex, page)
var rw ExchangeRW // Streaming APIs take the ReadWriter view.
ex.ReadWriter(&rw)
n, err := io.WriteString(&rw, page)
// Handler runs on the router goroutine: Error, never Fatal.
if err != nil {
t.Error(err)