-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
π₯ Feature (v3): Add buffered streaming support (#3131)
* π₯ Feature: Add SendStreamWriter to Ctx Create a new `*DefaultCtx` method called `SendStreamWriter()` that maps to fasthttp's `Response.SetBodyStreamWriter()` * π¨ Test: Validate regular use of c.SendStreamWriter() - Adds Test_Ctx_SendStreamWriter to ctx_test.go * π¨ Test: (WIP) Validate interrupted use of c.SendStreamWriter() - Adds Test_Ctx_SendStreamWriter_Interrupted to ctx_test.go - (Work-In-Progress) This test verifies that some data is still sent before a client disconnects when using the method `c.SendStreamWriter()`. **Note:** Running this test reports a race condition when using the `-race` flag or running `make test`. The test uses a channel and mutex to prevent race conditions, but still triggers a warning. * π Doc: Add `SendStreamWriter` to docs/api/ctx.md * π©Ή Fix: Remove race condition in Test_Ctx_SendStreamWriter_Interrupted * π¨ Styles: Update ctx_test.go to respect golangci-lint * π Doc: Update /docs/api/ctx.md to show proper `w.Flush()` error handling * π Doc: Add SendStreamWriter details to docs/whats_new.md * π¨ Styles: Update /docs/whats_new.md to respect markdownlint-cli2 * π©Ή Fix: Fix Fprintf syntax error in docs/whats_new.md --------- Co-authored-by: M. Efe Γetin <[email protected]>
- Loading branch information
Showing
5 changed files
with
174 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31a503f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold
1.50
.Benchmark_Ctx_Send
6.506
ns/op 0 B/op 0 allocs/op4.335
ns/op 0 B/op 0 allocs/op1.50
Benchmark_Ctx_Send - ns/op
6.506
ns/op4.335
ns/op1.50
Benchmark_Utils_GetOffer/1_parameter
206.1
ns/op 0 B/op 0 allocs/op131
ns/op 0 B/op 0 allocs/op1.57
Benchmark_Utils_GetOffer/1_parameter - ns/op
206.1
ns/op131
ns/op1.57
Benchmark_Middleware_BasicAuth - B/op
80
B/op48
B/op1.67
Benchmark_Middleware_BasicAuth - allocs/op
5
allocs/op3
allocs/op1.67
Benchmark_Middleware_BasicAuth_Upper - B/op
80
B/op48
B/op1.67
Benchmark_Middleware_BasicAuth_Upper - allocs/op
5
allocs/op3
allocs/op1.67
Benchmark_CORS_NewHandler - B/op
16
B/op0
B/op+β
Benchmark_CORS_NewHandler - allocs/op
1
allocs/op0
allocs/op+β
Benchmark_CORS_NewHandlerSingleOrigin - B/op
16
B/op0
B/op+β
Benchmark_CORS_NewHandlerSingleOrigin - allocs/op
1
allocs/op0
allocs/op+β
Benchmark_CORS_NewHandlerPreflight - B/op
104
B/op0
B/op+β
Benchmark_CORS_NewHandlerPreflight - allocs/op
5
allocs/op0
allocs/op+β
Benchmark_CORS_NewHandlerPreflightSingleOrigin - B/op
104
B/op0
B/op+β
Benchmark_CORS_NewHandlerPreflightSingleOrigin - allocs/op
5
allocs/op0
allocs/op+β
Benchmark_CORS_NewHandlerPreflightWildcard - B/op
104
B/op0
B/op+β
Benchmark_CORS_NewHandlerPreflightWildcard - allocs/op
5
allocs/op0
allocs/op+β
Benchmark_Middleware_CSRF_GenerateToken - B/op
518
B/op327
B/op1.58
Benchmark_Middleware_CSRF_GenerateToken - allocs/op
10
allocs/op6
allocs/op1.67
This comment was automatically generated by workflow using github-action-benchmark.