From 61863eb46d88a69e95c3f748a1e9df2d4b547f2a Mon Sep 17 00:00:00 2001 From: t Date: Fri, 30 Oct 2026 01:58:33 -0600 Subject: Start warming turns with callback-form run_async 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. --- init.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'init.lua') 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) -- cgit v1.3