summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authort <t@tjp.lol>2026-10-30 01:58:33 -0600
committert <t@tjp.lol>2026-10-30 08:17:49 -0600
commit61863eb46d88a69e95c3f748a1e9df2d4b547f2a (patch)
treeaf257d8e46d500327d315c711fe381057ce25cc9 /init.lua
parenta139aba0d7426c5961ea26ec8d1ce70de25f12e6 (diff)
Start warming turns with callback-form run_asyncHEADv0.2.0main
Drive the warm turn from the luv timer with callback run_async, caching only its termination, and abandon with a nonjoining close. Removes native job polling. Adds binding-check.lua, a real-binding check against local HTTP fixtures, to mise run check. Requires a Pantograph host with callback-form run_async.
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/init.lua b/init.lua
index 5043e60..e552fe5 100644
--- a/init.lua
+++ b/init.lua
@@ -19,8 +19,8 @@ local config = require("warming.config")
local policy_mod = require("warming.policy")
local warm = require("warming.warm")
--- A tick is only bookkeeping (poll a job, compare timestamps), so a coarse
--- period is plenty; it is clamped to [1s, 30s].
+-- A tick only inspects extension-owned terminal state and starts a callback
+-- turn when due; it never polls or advances a native operation.
local TICK_MAX_MS = 30000
local function host()
@@ -126,7 +126,8 @@ local function activate()
tick = function()
local now = uv.now()
if current then
- local result = warm.poll(current)
+ local handle = current
+ local result = warm.poll(handle)
if result then
current = nil
policy:attempted(now)
@@ -173,8 +174,9 @@ local function activate()
timer = nil
end
if current then
+ -- Keep the wrapper references through Lua-state teardown; close is
+ -- nonjoining and the binding manager owns native retirement.
warm.abandon(current)
- current = nil
end
end)