Mercurial Hosting > luan
comparison host/admin/src/hi.txt.luan @ 2021:b8e5d53c4fc9
admin monitors scheduler
| author | Franklin Schmidt <fschmidt@gmail.com> |
|---|---|
| date | Mon, 20 Oct 2025 14:45:27 -0600 |
| parents | host/admin/src/hi.luan@301a6561fb6b |
| children |
comparison
equal
deleted
inserted
replaced
| 2020:163f88f7ee00 | 2021:b8e5d53c4fc9 |
|---|---|
| 1 local Io = require "luan:Io.luan" | |
| 2 local Http = require "luan:http/Http.luan" | |
| 3 local Thread = require "luan:Thread.luan" | |
| 4 local Time = require "luan:Time.luan" | |
| 5 | |
| 6 | |
| 7 local globals = Thread.global_map("globals") | |
| 8 globals.i = 0 | |
| 9 | |
| 10 local function inc() | |
| 11 globals.i = globals.i + 1 | |
| 12 end | |
| 13 | |
| 14 Thread.schedule( inc, {repeating_delay=Time.period{minutes=1}} ) | |
| 15 | |
| 16 return function() | |
| 17 Io.stdout = Http.response.text_writer() | |
| 18 %>hi <%=globals.i%><% | |
| 19 end |
