1
0
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:
Gerasimos Maropoulos
2018-04-10 21:01:24 +03:00
parent 989cb3f045
commit cb69df2ccf
7 changed files with 105 additions and 62 deletions

View File

@@ -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++