Mercurial Hosting > luan
annotate website/src/examples/chunked.html.luan @ 2020:163f88f7ee00
for nabble
| author | Franklin Schmidt <fschmidt@gmail.com> |
|---|---|
| date | Sun, 05 Oct 2025 20:43:42 -0600 |
| parents | bba3e529e346 |
| children |
| rev | line source |
|---|---|
| 2008 | 1 local Luan = require "luan:Luan.luan" |
| 2 local error = Luan.error | |
| 3 local range = Luan.range or error() | |
| 4 local Thread = require "luan:Thread.luan" | |
| 5 local sleep = Thread.sleep or error() | |
| 6 local Io = require "luan:Io.luan" | |
| 7 local Http = require "luan:http/Http.luan" | |
| 8 | |
| 9 | |
| 10 return function() | |
| 11 Http.response.write_chunked_text(function(writer) | |
| 12 Io.stdout = writer | |
| 13 for i in range(1,10) do | |
| 14 %> | |
| 15 line <%=i%><br> | |
| 16 <% | |
| 17 writer.flush() | |
| 18 sleep(1000) | |
| 19 end | |
| 20 end) | |
| 21 end |
