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
national-gold•4mo ago
you mean "where would I install that event handler"?
absent-sapphireOP•4mo ago
Yes, basically.
national-gold•4mo ago
would do it in server.ts (on the alpha branch)
absent-sapphireOP•4mo 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
.national-gold•4mo ago
we have not documented this yet
national-gold•4mo 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
absent-sapphireOP•4mo 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
?national-gold•4mo ago
pretty close
we still need to fix some bugs
before we can merge to main
absent-sapphireOP•4mo 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
?national-gold•4mo 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
absent-sapphireOP•4mo ago
Cool! Thanks!