Mercurial Hosting > luan
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/host/admin/src/hi.txt.luan Mon Oct 20 14:45:27 2025 -0600 @@ -0,0 +1,19 @@ +local Io = require "luan:Io.luan" +local Http = require "luan:http/Http.luan" +local Thread = require "luan:Thread.luan" +local Time = require "luan:Time.luan" + + +local globals = Thread.global_map("globals") +globals.i = 0 + +local function inc() + globals.i = globals.i + 1 +end + +Thread.schedule( inc, {repeating_delay=Time.period{minutes=1}} ) + +return function() + Io.stdout = Http.response.text_writer() + %>hi <%=globals.i%><% +end