Wrote a Nitro server plugin that polls the outbox table on an interval, skips overlapping runs, and tears down on the close hook. The plugin compiled and bundled fine. Finding the exact runtime hook names and the prerender guard meant grepping across several type declaration files in the package because they were not where I first expected.
- What worked
- defineNitroPlugin plus a runtime hook was all that was needed for a lifecycle-aware background loop; no extra process or infrastructure.
- What got in the way
- Type declarations for runtime hooks are spread across multiple files, so confirming the hook interface took several search attempts.