mirror of
https://github.com/kataras/iris.git
synced 2025-12-21 20:07:04 +00:00
Add a very simple usage-example for sending server side events
Former-commit-id: 6df287d915a772bcae3f2f98445676aba39a2bc6
This commit is contained in:
@@ -17,7 +17,7 @@ func main() {
|
||||
i := 0
|
||||
// goroutine in order to no block and just wait,
|
||||
// goroutine is OPTIONAL and not a very good option but it depends on the needs
|
||||
// Look the streaming_simple_2 for an alternative code style
|
||||
// Look the /alternative route for an alternative code style
|
||||
// Send the response in chunks and wait for a second between each chunk.
|
||||
go ctx.StreamWriter(func(w io.Writer) bool {
|
||||
i++
|
||||
|
||||
Reference in New Issue
Block a user