Is there an equivalent to unstable_after() in h3?
https://nextjs.org/docs/app/api-reference/functions/unstable_after
Im running into an issue with stripe where I need to respond quickly before doing some longer running tasks. Does Nuxt/nitro/h3 have some version of unstable_after() where i can send off a 200 status code then keep doing work in a serverless env?
Functions: unstable_after | Next.js
API Reference for the unstable_after function.
7 Replies
Possibly could use this?
https://nitro.unjs.io/guide/tasks#scheduled-tasks
Tasks - Nitro
Nitro tasks allow on-off operations in runtime.
event.waitUntil
Sweeeeet thanks
It's not entirely the same I now realize: https://nextjs.org/docs/app/api-reference/functions/unstable_after#alternatives
Functions: unstable_after | Next.js
API Reference for the unstable_after function.
https://github.com/unjs/nitro/issues/1705#issuecomment-1711497734
Maybe this is actually the best?
GitHub
Support deferred functions with
waitUntil
· Issue #1705 · unjs/ni...Describe the feature I have an endpoint I don't want the user to wait while I talk to third party apis that isn't critical to the response So such logic could be run after the response has ...
using the object syntax afterResponse Hook
Seems like it. I’ve never used h3 object syntax