Mercurial Hosting > luan
comparison website/src/examples/chunked.html.luan @ 2008:bba3e529e346 default tip
chunked encoding
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 27 Aug 2025 01:14:17 -0600 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
2007:408f7dd7e503 | 2008:bba3e529e346 |
---|---|
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 |