SIGTERM hook/teardown logic
I have a TanStack Start app, and it needs to perform some teardown logic when receiving a SIGTERM. What would be a suitable place for such a hook?
11 Replies
exotic-emerald•6mo ago
you mean "where would I install that event handler"?
harsh-harlequinOP•6mo ago
Yes, basically.
exotic-emerald•6mo ago
would do it in server.ts (on the alpha branch)
harsh-harlequinOP•6mo ago
Hm, is there any chance to get a pointer to the repo? I checked the
alpha branch and all the examples, but I didn't find an indicator on how to use the server.ts.exotic-emerald•6mo ago
we have not documented this yet
exotic-emerald•6mo ago
but you can have a look at https://github.com/TanStack/router/blob/alpha/e2e/react-start/basic/src/server.ts
GitHub
router/e2e/react-start/basic/src/server.ts at alpha · TanStack/router
🤖 Fully typesafe Router for React (and friends) w/ built-in caching, 1st class search-param APIs, client-side cache integration and isomorphic rendering. - TanStack/router
harsh-harlequinOP•6mo ago
I see, thanks for the pointer, @Manuel Schiller
The
alpha branch is all about migrating away from Nitro and Vinxi, right? How close is it to being promoted to beta?exotic-emerald•6mo ago
pretty close
we still need to fix some bugs
before we can merge to main
harsh-harlequinOP•6mo ago
Sounds good. I'm a little hesitant to switch to the alpha in our production app, though. On the other hand, we really need the possibility for some teardown logic. Are there any hard breaking changes that I need to take into account when using the
alpha?exotic-emerald•6mo ago
GitHub
Start BETA - Tracking · TanStack router · Discussion #2863
Tracking any important changes for TanStack Start during the BETA period. If you are coming from the ALPHA of TanStack Start, you can see all the breaking changes that were made here - #2403
harsh-harlequinOP•6mo ago
Cool! Thanks!