Merge 4d47c2afd7b61ab5201e4a4cb3fbc05e92fd1e1c into 44d0dd70924dd154e3b98bc340accc53484efa9c

This commit is contained in:
Xiang Shi 2023-11-30 00:04:27 +08:00 committed by GitHub
commit a0119565b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1078,7 +1078,9 @@ func (c *Context) SSEvent(name string, message any) {
}
// Stream sends a streaming response and returns a boolean
// indicates "Is client disconnected in middle of stream"
// indicates "Will the client be connected in middle of stream"
// i.e. if return true, the client will keep connected
// if return false, the client will be disconnected
func (c *Context) Stream(step func(w io.Writer) bool) bool {
w := c.Writer
clientGone := w.CloseNotify()